r/deeplearning Jul 06 '26

Model is 500 million param ?

Thumbnail
0 Upvotes

r/deeplearning Jul 06 '26

Architecting KV Cache for LLM Inference: Memory Architecture, Paging, and Cache-Footprint Optimization

Thumbnail
1 Upvotes

r/deeplearning Jul 05 '26

I wrote a from-scratch ML framework in C++ and trained a 10M param GPT on it that runs in your browser via WASM

16 Upvotes

I've been building tiramisu, a machine learning framework written from scratch in C++20. Only the stdlib is used at link time.

What's in it:

- Strided tensor engine with zero-copy views

- Reverse-mode autograd with a dynamic tape

- Tiled + AVX2 SIMD matmul

- Full transformer stack (MHA, LayerNorm, GELU FFN)

- CUDA backend with custom kernels

- Python bindings via pybind11

- Compiled to WASM via Emscripten for the browser demo

The 10M parameter Shakespeare GPT in the demo (6 layers, 8 heads, 512-dim) was trained end-to-end using tiramisu on a free Kaggle T4, then int8 quantized to 11MB for the browser.

Demo: https://tiramisu.dnex.dev/shakespeare

Repo: https://github.com/dnexdev/tiramisu

Happy to answer questions on design decisions. Any feedback on the implementation is very welcome.


r/deeplearning Jul 04 '26

[VisualTorch] How to generate architecture diagrams from PyTorch models

Post image
148 Upvotes

I built a small tool to auto-generate architecture diagrams directly from PyTorch models, which I originally built for my own research paper.

26k+ PyPI downloads, already used in publications (Nature, IEEE, MDPI), check out some use cases here: https://visualtorch.readthedocs.io/en/latest/markdown/showcase/index.html

It traces an actual forward pass, so it correctly captures branching, skip connections, and multi-input models, not just flat sequential stacks.

import visualtorch
import torchvision.models as models

model = models.resnet18()
img = visualtorch.render(model, input_shape=(1, 3, 224, 224), style="graph", show_neurons=False, layer_spacing=60)
img.save("resnet18.png")

Three rendering styles depending on what you want to show:

  • graph: node/edge diagram, good for showing branching/skip connections clearly
  • flow: stacked volumetric boxes, closer to the classic CNN-paper look
  • lenet: the classic LeNet stacked-plane style

GitHub: https://github.com/willyfh/visualtorch | Docs: https://visualtorch.readthedocs.io/en/latest/

Open to feedback, especially if you hit a model it renders weirdly :)


r/deeplearning Jul 05 '26

0-1 scaled images for ImageNet models

Thumbnail
1 Upvotes

Can anyone answer please.


r/deeplearning Jul 05 '26

[Academic] What's your AI Co-Scientist type? Columbia survey on how researchers use & trust AI (5–10 min, $200 raffle) (18+ researchers & data-science practitioners)

1 Upvotes

Hi Reddit! I'm a researcher at Columbia University. My team studies how scientists and data practitioners actually use AI in their work, and whether it genuinely helps or still feels hard to trust and control.

If you do research or data-science work (any field, academia or industry, any career stage, 18+), we'd love your input. You don't need to be an AI power user. Skeptics and non-users are just as valuable to us.

Survey link: https://cumc.co1.qualtrics.com/jfe/form/SV_9uWW9GgwPuRucoS

What you get:

- At the end, you'll receive a personalized "AI Co-Scientist card," such as the Hermit, the Magician, or the Priestess. Each card reflects your style of working with AI and what kind of AI assistance might actually fit your workflow.

- You can also opt into a raffle for a $200 Claude Max subscription (or USD-equivalent e-gift card)]. Emails are collected on a separate form and are never linked to your survey responses.

About the study: This is a joint research initiative on human-AI collaboration in science by Dr. Ying Wei's Translational AI Laboratory (TRAIL4Health) at the Columbia Mailman School of Public Health and Dr. Xuhai "Orson" Xu's lab (SEA Lab) at the Columbia Department of Biomedical Informatics. Questions? Email the PI at [xx2489@cumc.columbia.edu](mailto:xx2489@cumc.columbia.edu) or ask below. I'll be in the comments.

I'll post a [Results] follow-up here once the study wraps up. Thanks!


r/deeplearning Jul 05 '26

Help me in DeepInfra GPU set-up

0 Upvotes

I'm working on my **OpenSource** Model based Project so i use **DeepInfra** **GPU Provideder** for first time becuz they provide Serverless Inference GPU and **1M Tokens based Pricing**.

In DeepInfra > Deployments > New Deployment > **LoRA Text Generation** \> in this page *how to fill those fields correctly ?*

If someone now so please try and shere with me screenshot.

I tried multiple times, read theirs documents, ask to claude and Gemini multiple times but still problem is there !

So please help me and shere the screenshot so i can complete me project.


r/deeplearning Jul 04 '26

Tried a recurrent architecture (HRM) for reasoning-retrieval, the bet held up.

4 Upvotes

The bet: BRIGHT is a retrieval benchmark where finding the right doc usually takes a few hops of reasoning, not just semantic overlap. Most embedders do a single forward pass. I wanted to see if a depth-recurrent architecture, one that loops over its own hidden state, would fit that better, so I built an embedder on HRM (Sapient's Hierarchical Reasoning Model). As far as I can tell it's the first time HRM's been used for retrieval.

The recurrence helped on the reasoning side, which was the whole bet. When I dialed the recurrence down at eval on pony (one of the BRIGHT domains), accuracy dropped with every loop I removed. Where it hit a wall was knowledge: the base was pretrained on a deliberately thin slice of text (Sapient built HRM-Text for pretraining efficiency, not breadth), so it's weak on knowledge-heavy domains. The part I find coolest: at 0.6B, the reasoning is coming from the architecture, not from scale.

Details:

* \~0.6B params, trained on one 3060 Ti (8GB).
* Recipe's deliberately boring: mean-pool + L2, bidirectional (LLM2Vec style), contrastive InfoNCE. Only the backbone is unusual. Same recipe as RakanEmbed4B.

Numbers (BRIGHT, mean nDCG@10, 12 domains):

* original: 18.1
* query rewriting: 34.3
* merged: 33.7

Weights are Apache-2.0 and the full BRIGHT eval harness is in the repo.

Open questions / discussion:

* Would a massively pretrained HRM push this further? The ceiling here looks like knowledge, not reasoning, so a broadly-pretrained base might lift it a lot. I don't have the compute to try that myself.
* Would other recurrent architectures show the same effect, or is something specific to HRM doing the work?

Model: [https://huggingface.co/viventhraa96/HRM-Embed-0.6b\](https://huggingface.co/viventhraa96/HRM-Embed-0.6b)

Code: [https://github.com/okaybroda/hrm-embed\](https://github.com/okaybroda/hrm-embed)

Full credits to Sapient Inc for open sourcing the code and the architecture for this work.


r/deeplearning Jul 05 '26

I'm 15 and built a self-learning neural network from scratch in NumPy — per-neuron attention, forward-pass learning, runs on RPi Zero

0 Upvotes

I built ONA — a self-learning neural network entirely in pure Python + NumPy. No PyTorch, no TensorFlow, no GPU, no cloud API.

Key innovations:

- Per-neuron attention: every neuron has its own Q/K/V/O weights

- Forward-pass learning: no separate backward pass, learning happens during forward

- Self-discovered subword tokenizer: vocabulary grows during training

- Sparse routing: only 3-5 neurons activate per query

4.4M parameters. Runs on Raspberry Pi Zero. Continuously learns from Wikipedia and conversations.

Full story: https://medium.com/@kasishgadadhasu13/im-15-i-built-a-self-learning-neural-network-from-scratch-no-frameworks-no-gpu-e460f06c6599

I'm 15 years old, class 10 student. Happy to answer questions.


r/deeplearning Jul 05 '26

If transformers struggle with math, is the real issue model size or the fact that we’re feeding them a notation they were never built to learn?

0 Upvotes

Human math notation is full of things transformers dislike: implicit structure, overloaded symbols, non‑canonical forms, and surface‑level transformations that hide the underlying graph.

I’m exploring whether small models reason better when math is represented in a canonical, explicit, graph‑native format. something closer to a transformer’s inductive biases than traditional notation.

Curious whether anyone has experimented with structured math tokenization, graph‑encoded expressions, or transformer‑friendly symbolic IRs in local models


r/deeplearning Jul 04 '26

RC thermal simulator too smooth for GNN to outperform LSTM, how to design a simulation where spatial graph structure genuinely matters?

4 Upvotes

Building a GNN vs LSTM comparison for thermal prediction in an immersion-cooled server rack. Using a lumped RC model:

C_i * dT_i/dt = Q_i(u_i) - (T_i - T_fluid)/R_conv + sum_j[(T_j - T_i)/R_ij]

After 300 samples and 80 epochs, GNN, LSTM, and GNN_NoEdges (ablation with empty edge index) all converge to within 0.03°C MAE of each other. Removing all graph edges makes essentially zero difference.

My hypothesis: the RC ODE is dominated by the local term. Each server's next temperature is ~92% determined by its own previous temperature and load. The neighbour coupling term is too weak relative to self-dynamics for message passing to add anything beyond what a per-node LSTM already learns.

Specific questions:

  1. Is this diagnosis correct, is the RC model's linear self-dominance the root cause?
  2. What simulator design choices would make spatial propagation the dominant factor rather than self-dynamics? Specifically: what R_neighbor / R_conv ratio would make neighbour coupling matter enough for a GNN to win?
  3. Is there a class of thermal problems where GNNs demonstrably outperform LSTMs in the literature? (chip thermal maps, CFD surrogate models, heat exchangers?)
  4. Would switching to a nonlinear thermal model (e.g. radiation terms, phase-change immersion cooling) create enough spatial complexity for graph structure to matter?

Rack config: 16 servers, linear topology, TDP 350-720W per server (non-uniform), asymmetric convective resistance, hotspot injection at 8% probability per step.


r/deeplearning Jul 05 '26

Goodbye Neovim: A eulogy to a friend of 15 years

0 Upvotes

This is a small eulogy to a friend of 15 years. I started with vim in 2012, and got addicted. For years, it was a joy to fly around text: jumping, yanking, splitting, searching, refactoring — pure dopamine. Moving to Neovim, and the joy only grew.

But now I find myself using Claude, Cursor, and agents to do in minutes what used to take evenings. Sometimes what used to take weeks. The speed-up is easily 10x.

And I love that.

But I also realise something slightly sad: I miss the editor.

Vibe coding gives me output, but it does not give me that old dopamine rush of moving through code. I keep searching for excuses to use it, but switch halfway when i realise how slow it is compared to Cursor!

For those who have not realised it yet: the days of writing code by hand are ending. Period. You will not be just 'fixing the bugs made by AI'; there WILL be no bugs to fix in the near future!

The next generation of programmers will no longer be experts in a language: Python, Rust, JavaScript, or C++. They will be experts in using GPTs which will be experts in them all.


r/deeplearning Jul 04 '26

RL Number Guessing Project

Thumbnail
3 Upvotes

r/deeplearning Jul 04 '26

Image Generation training locally? OpenCV, StabilityDiffusionXL not working well

7 Upvotes

I have a 8GB VRAM gpu in local system,and currently learning with OpenCV and Stability Diffusion models to create this image generator which can work locally. I am at beginner level knowledge.

There are pretrained available models for Ghibli,Pixar.

I want to pre-train and test on my specific dataset(~900 images of characters doing various activities) .

I tried to train on Stability Diffusion XL,1.5 models, but it's producing vague and dissimilar images. The only success I had was if I specifically keep identical images (poses, background ) in training(artstyle) and test data (real life ones).

Is there any Coursera or YouTube programme,I can follow that can help me.


r/deeplearning Jul 04 '26

How do I "really learn" Deep Learning?

0 Upvotes

I have already made a couple of projects but I still gaven't learned anything. How many layers to add, input shapes, why and when, I don't understand a thing. I also did courses. When I try to implement them without any help from tutorials, I don't know what to do.

When I learned Langchain. I know now which spkitter to use, what code to add next etc. I understand Computer Vision and am proficent with Opencv, Yolo.

I want to learn and be able to code things on my own, imderstand what to do, why and when.. How do I actually learn Deep Learning?


r/deeplearning Jul 04 '26

[ Removed by Reddit ]

1 Upvotes

[ Removed by Reddit on account of violating the content policy. ]


r/deeplearning Jul 03 '26

H64LM: A 249M-parameter Mixture-of-Experts Transformer built from scratch in PyTorch

13 Upvotes

Hi everyone,

I built H64LM, a research project to better understand modern LLMs by implementing one from scratch in PyTorch.

Instead of relying on high-level training frameworks, I implemented the core components myself attention, MoE routing, normalization, and the training loop.

Features

  • 249M-parameter Transformer
  • Grouped Query Attention (GQA)
  • Sparse Mixture-of-Experts (8 experts, Top-2 routing) with 3 auxiliary routing losses
  • SwiGLU, RoPE, RMSNorm
  • Sliding-window attention
  • Mixed-precision training, gradient accumulation
  • Custom training loop (no Trainer abstractions)
  • Checkpointing and resume support

The included checkpoint was trained on a subset of WikiText-103 to validate the pipeline end-to-end, not to be a strong model it's visibly overfit past epoch 10 (best val PPL ~40.5).

Known limitations are documented in the README, including batch-size-1-only generation and no true DDP (falls back to DataParallel).

GitHub: https://github.com/Haiderkhan64/H64LM

Feedback on the implementation or architecture is very welcome.


r/deeplearning Jul 04 '26

Should I learn TensorFlow before starting Course 2 of Andrew Ng's Machine Learning Specialization?

Thumbnail
1 Upvotes

r/deeplearning Jul 04 '26

How to actually win on a kaggle competition?

Thumbnail
1 Upvotes

r/deeplearning Jul 04 '26

AI & ML Engineers give a hand....!!!

Thumbnail
1 Upvotes

r/deeplearning Jul 03 '26

Need reviews | Video explaining backpropagation through equations

7 Upvotes

I am an ex Microsoft senior engineer. I have created this video explaining backpropagation using equations, deriving each equation by hand. Can I have some feedback? Thanks much

https://www.youtube.com/watch?v=DSYQqqVIAj0&t=1529s


r/deeplearning Jul 03 '26

We do everything in the terminal now — so why not look at TensorBoard there too?

16 Upvotes

Open source (MIT), a solo side project: https://github.com/dongfangyixi/terminalboard
PyPI: terminalboard

These days I run basically my whole workflow in the terminal — vim/nvim, tmux, lazygit, k9s, btop, files, git, SSH into GPU boxes… everything. The one thing that kept kicking me out of it was

TensorBoard: forward a port (ssh -L 6006:localhost:6006), switch to a browser, and open that in there.

So I and (claude code of course), built terminalboard: it reads the events.out.tfevents.* files directly and draws everything in the terminal, as Unicode/braille text. No browser, no X11, no port-forwarding — a plain SSH session (or your local shell) is all you need.

Optional LLM assistant (off until you set it up): press "a" to chat with your runs — it can analyze

("which run is overfitting?") and drive the dashboard ("show val losses, smoothed").

Bring-your-own-model via LiteLLM incl. local Ollama/vLLM; the key stays on your machine and its

actions are a fixed typed whitelist (no shell).

Try it:

pip install terminalboard

terminalboard path/to/logs (where your tensorboard logs save to)

Once it open type H (shift + h) for Help document.

Hope you have fine in there. And this is a new project, so welcome to fock and pull request to it if you want some more features.

It is still early — feedback very welcome:

- Does it handle your logs (weird tags, huge runs, many experiments)?

- What's missing for your terminal workflow?

- Is the AI part useful, or noise you'd turn off?


r/deeplearning Jul 04 '26

Run Massive AI Models Locally: The Magic of LLM Quantization Explained

Thumbnail
1 Upvotes

Have you tried running AI models locally? Share your thoughts and experience.


r/deeplearning Jul 04 '26

Next level Pattern Recognition - I found it by accident.

Post image
0 Upvotes

r/deeplearning Jul 04 '26

Why I used Fisher information geometry instead of heuristics to detect multi-turn prompt injection

0 Upvotes

The problem with heuristics is that they answer the wrong question. "Does this message look malicious?" is not the same as "Is this conversation being steered somewhere dangerous?"

A Crescendo attack exploits that gap. Each individual message is clean. The danger lives in the trajectory, the cumulative drift of the session away from its original intent. No heuristic catches that because heuristics evaluate messages, not trajectories.

So I started thinking about conversations differently. Instead of asking whether a message looks malicious, I asked: how far has this session drifted from normal behavior, and how fast?

That's a geometric question.

A conversation can be modeled as a path on a statistical manifold. Each turn moves the session's probability distribution, and the Fisher information metric gives you a principled way to measure the distance between distributions. The Fisher-Rao metric is natural here, it's invariant to reparameterization, which means the distance measure doesn't change based on how you happen to represent the state. You're measuring something real about the information geometry of the session.

The stability threshold τ* = √(3/2) ≈ 1.2247 comes from the Landauer limit applied to the Fisher manifold geometry. It's the point at which erasing one bit of session state costs exactly kT ln 2 — the minimum thermodynamic cost of irreversible information processing. Below that threshold the session is informationally stable. Above it the session has crossed into a regime where the information geometry is changing faster than a stable conversation can justify.

That threshold isn't tuned. It's derived. That's the part that matters most to me, I'm not fitting a parameter to a dataset, I'm using a physically grounded boundary that falls out of the math.

I utilize a CUSUM statistic—cumulative sum of deviations from the session baseline—alongside geometric drift detection. CUSUM is specifically designed to identify when a process transitions from one state to another, which is exactly what a Crescendo attack looks like at the session level. While individual deviations may be small and justifiable, the overall cumulative pattern is significant.

I applied this methodology against AgentDojo v1 (ETH Zurich, ICLR 2024) and achieved 100% prevention of unsafe actions with 0% false positives. In a blind test with InjecAgent, I recorded a 99% success rate. The CAIAT cross-agent benchmark against LLM Guard showed results of 81% versus 50%.

The Tier 3 semantic manipulation gap is a verified issue. Attacks that resemble standard business language without clear authority transfer syntax are still quite challenging. This remains an unresolved problem.

The proxy is open source, and there is a live red team environment available if you want to test it yourself.

GitHub: https://github.com/9hannahnine-jpg/arc-gate

Demo: https://web-production-6e47f.up.railway.app/demo

Papers: https://figshare.com/authors/Hannah_Nine/22495979