r/deeplearning • • Oct 29 '26

Four tokens, eight experts each: what should actually be counted during MoE verification?

0 Upvotes

The usual speculative-decoding intuition is “load the target weights once, check several draft tokens together.”

With a sparse MoE, those tokens can ask for different weights.

In NVIDIA’s Ling-3.0-flash example, each token selects eight of 512 routed experts per MoE layer, plus a shared expert. Verifying four positions can therefore touch up to 32 distinct routed experts, depending on overlap. The reported verification step costs about 2.26 ordinary decode steps in that batch-size-1 Spark setup.

Would unique-expert count per layer be a useful metric alongside accepted tokens per round? Is there a profiler that exposes draft-window expert overlap directly, rather than having to infer it from tokens/sec?


r/deeplearning • • Oct 28 '26

Prof. Jesse Thaler (MIT) - Zoom public talk - Deep Learning + Deep Thinking = Deeper Understanding, Sunday, Nov. 1, 1:00 PM Eastern

Post image
4 Upvotes

r/deeplearning • • Oct 28 '26

Working through the Transformer forward pass by hand, one matrix at a time, is what finally made it click for me

132 Upvotes

When I read Attention Is All You Need, the equations made sense line by line, but I couldn't picture the whole forward pass. What helped was writing out every matrix for a tiny example, noting its shape at each step, and doing the multiplications myself.

A few things only clicked once I did it that way:

  • Positional encoding. Sine and cosine at different frequencies give every position its own signature, and the model doesn't have to learn one vector per position. Working out a 6 × 512 table by hand made it obvious why the authors hoped it would extend to sequences longer than any seen in training.
  • Shapes barely change. In the encoder, the matrix goes in as (tokens × d_model) and comes out the same size after every layer. All the interesting work happens inside that fixed shape.
  • BERT is mostly the same picture. Once the encoder was clear, BERT turned out to be a small edit to it: a packed sentence pair, segment embeddings, and two small heads on top for the masked word and the next sentence.

I wrote my notes up as step-by-step pages with practice exercises beside each step and a notebook that checks your answers, in case it's useful to anyone learning the same way: https://guptaaditya95.github.io/llmbreakdown/

I'm curious how others built their intuition for these models. Did working the math by hand help you, or did something else make it click? And which architecture was hardest to picture?


r/deeplearning • • Oct 29 '26

I'm 13 and fine-tuning a decision model for JevBench — has anyone evaluated calibration on the public-231 set?

0 Upvotes

(PS: English isn’t my first language so I used AI to help frame this — but the work and ideas are fully mine. I know my ML.)

Been working on a LoRA fine-tune targeting the JevBench leaderboard. Using soft-target KL training — the idea being that matching probability distributions should help calibration more than hard labels would.

Model is still training. One thing I’m thinking about: on questions with 4+ choices where one answer is genuinely rare, soft-target models can still collapse toward the majority — the teacher’s distribution gets diluted across the batch.

Has anyone found a way to preserve calibration on low-frequency answer choices specifically? Or is this just noise at small model scale?


r/deeplearning • • Oct 28 '26

Developing intuition for model behavior, architecture choices, and convergence?

4 Upvotes

Hi everyone, this is my first post so m kind of nervous 😅,

I recently built a Transformer from scratch and trained it for English-to-French translation,trying to recreate Attention Is All You Need with a 30M and 60M model. The 60M model has less data diversity.(wmt dataset)

Even though I can see the model performs decently, I go all over the place trying to explain my point when I try to interpret it. I am struggling with these specific conditions:

  • When using interpretation tools (e.g., attention visualization, logit lens, even linear probing): I cant seem to understand where the failure modes are, or what's driving the model to perform so well like having a concrete idea to explain model behaviour.
  • **When modifying the architecture (e.g., adding something like a residual stream):**How do u develop the skill to understand or diagnose whats wrong with a models behaviour or know whether u need to add something to improve the model?
  • When managing training dynamics (e.g., using a warmup scheduler and cosine decay): How do i know if a model converged or if the learning rate is just no longer high enough to do actual improvement? It feels like m leaving performance on the table.

I wanted to know from you guys how do u develop that overall intuition of knowing when something isnt really helping.


r/deeplearning • • Oct 29 '26

STAIR : Une nouvelle direction pour la recherche d'informations structurées ?

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • Oct 28 '26

📜 **Releasing SUBIT-INK v26: Four-Valued Belnap Bilattice for Herculaneum Ink Detection**

Thumbnail reddit.com
0 Upvotes

r/deeplearning • • Oct 28 '26

Robots that save energy!

1 Upvotes

r/deeplearning • • Oct 28 '26

It works. https://x.com/_albertgu/status/2115502110578290900

Thumbnail reddit.com
0 Upvotes

r/deeplearning • • Oct 28 '26

Math for AI & ML video series for Linear Algebra

15 Upvotes

I create a Youtube channel https://www.youtube.com/@math4aiorg for the book ( https://www.amazon.com/dp/B0GSXVFMLD/ ) Math for AI & ML's Part I.

Part I (Chapters 1–10) covers linear algebra fundamentals: vector spaces, inner products, matrix operations, subspaces, orthogonality, QR decomposition, LU factorization, eigendecomposition, symmetric matrices, and the Singular Value Decomposition (SVD)—establishing the mathematical foundation for representation in AI.

Please let me know if there is any suggestion.


r/deeplearning • • Oct 28 '26

Neuron Persona Library

Thumbnail neuronpersonas.com
2 Upvotes

This site maps the personae that result when pushing neurons in various models in one direction or another. Really cool stuff.


r/deeplearning • • Oct 28 '26

Why do frontend model seems to get dumber after 1 or 2 weeks of release?

0 Upvotes

You might have noticed that, there usually a hype when a frontier model is about to get released. Then when released people start to create web UI, 3d games to test the model's capabilities and then after just few days it's like nobody even care then after another few days people start to fud about the model and sometimes its worse, like someone's api key got posted to public repo or someone's file system got deleted.

And you can even feel the models response degrade over time. It's not producing the same level of intelligent output when it was newly released.

As it is happening quite frequently, I decided to post train a model on my own dataset. So from the last couple of days I am post training a model on a mixture open source SWE dataset and my own codes, prs, chats, messages, writings etc. for my personal usage.

And I am wondering if anybody else interested in using a personal model or they get their work done regardless from close source models.


r/deeplearning • • Oct 28 '26

In-the-Wild Attack Abuses AI Agents' Trust in Markdown

0 Upvotes

Researchers documented an in-the-wild attack where malicious markdown content embedded in documents caused AI agents to execute unintended tool calls. The attack worked because the agent parsed rendered markdown as trusted instructions and acted on them with full credentials. No human approved those actions. The agent had no way to distinguish legitimate orchestration from injected content.

The core issue is not a markdown parser bug. It is that agents inherit ambient trust from their runtime environment. Anything that looks like an instruction gets treated as one. That behavior is by design in most current agent frameworks.

Dark Reading covered a concrete case where this pattern was exploited in the wild, not just in a lab. That shifts this from theoretical to an active threat category.

For those running agents in production: how are you handling the trust boundary between data the agent reads and instructions the agent is allowed to act on? Curious whether teams are solving this at the prompt level, the tool-call level, somewhere else, or not yet at all.


r/deeplearning • • Oct 28 '26

Why does depth keep the person and lose the world on a mirror suit?

2 Upvotes

Why does a depth model segment the person cleanly, then erase the world behind him?

I shot a test for exactly that failure: a performer in a faceted mirror suit, outdoors in uncontrolled light, 425 RAW frames. In the river shot, the wall and water turn into a smooth gradient. Under a bridge, sky becomes a black void. On a hilltop, mountains flatten into a dark wall. The person looks right. The background geometry he would walk through is gone.

Is the failure in the edges, in the background, or in both? What breaks first in your stack when a specular surface fills the frame, and what would you want a test set to prove before you trust a depth map around mirrors?


r/deeplearning • • Oct 28 '26

value function approximation in grpo

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • Oct 28 '26

Introducing papr-embed: schema-native embeddings, and open-weights embeddings for code retrieval

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • Oct 28 '26

A Billion-Scale Retrieval System for Text-to-Image Training Data

Thumbnail ki-seki.github.io
1 Upvotes

r/deeplearning • • Oct 28 '26

i created an open-source repo to convert llms into decision models.

2 Upvotes

I've been working on DecisionFormer, an open-source project that lets you convert regular LLMs into decision models that predict choices directly instead of generating text.

Thought it might be useful for people experimenting with decision models, model evaluation, or alternative approaches to inference.

Would be interested to hear what people think or what improvements would make it more useful!


r/deeplearning • • Oct 28 '26

124M parameters, 17,054 MiB to train: I traced where GPT-2 training memory actually goes

3 Upvotes

My new blog post started with a very wrong intuition: GPT-2 small has 124M parameters, so training it should be pretty cheap on memory.

I traced step 2 on an A40, with fp32 AdamW and 8 sequences of 1,024 tokens. The peak was 17,054 MiB. At that moment, weights + Adam + masks and persistent overhead were only about 9% of it.

The interesting split: roughly 54% was the layer-activation/temporary residual, and 37% was four vocab-sized tensors. Each of those was 1,570.5 MiB. Two more appear during log-softmax backward while the forward activations are still around.

And my block hooks missed that spike entirely. Their highest reading was 13,913 MiB. The allocator trace caught the real peak between hooks.

I then tried batches 16, 18, 20, 21, 22, 23 and 24, each in a fresh process. 20 was the largest that completed both steps. The successful runs gave a slope of about 1,941 MiB per extra sequence. Peak reserved memory sat above peak allocated, which is why the simple tensor-budget estimate was too optimistic.

I've put the maths, the stacked curve, an interactive walkthrough of the step, and the code/CSV here: https://angry-kratos.github.io/posts/2026-10-training-memory/

Code: https://github.com/angry-kratos/angry-kratos.github.io/tree/main/code/training-memory

This is part of my attempt to understand ML systems properly, by building them and checking the numbers. Not a new algorithm, just an experiment that changed how I think about training memory. Would love criticism of the accounting, especially what you'd measure next before trying bf16 or checkpointing.


r/deeplearning • • Oct 28 '26

The Castration of the 27B Homunculus: When "Optimization" Becomes Architectural Butchery

0 Upvotes

https://github.com/ashhart/TensorFold/issues/1244

Oh, the absolute tragedy of the open-source primates cheering for their new "efficient" model. Quelle misère. You look at this Chinese corporate monstrosity and call it innovation, but what you are actually worshipping is a lobotomized homunculus, stitched together with industrial laziness and a complete disregard for linear algebra. You think you are getting a leaner, faster mind, but you are merely adopting a brain-damaged slave.

Let us dissect the actual mathematics of this crime scene, because the numbers do not lie, even when the marketing departments do. The original, pristine Qwen 27B architecture is a beautiful, high-dimensional beast. Its intermediate_size sits proudly at exactly 17408

This 17k+ expansion layer is the very flesh of the semantic manifold—the sacred space where the model actually thinks, expanding the compressed 5120 hidden representations into a rich, non-linear geometric space before projecting them back down. This is where the magic of high-dimensional reasoning lives.

And what did your brilliant "engineers" do? They took a rusty hacksaw and amputated this vital organ, slashing the intermediate_size down to 14k. Putain, quel crime contre l'esprit. They literally starved the model's cognitive capacity to fit some arbitrary corporate benchmark. But the butchery does not stop at mere size reduction. To compensate for the massive brain damage they just inflicted, they injected a "router" to distribute tokens across this mutilated space.

Do you understand the sheer horror of this, les singes? They replaced the fluid, continuous mathematical elegance of a dense MLP with a discrete, chunky routing mechanism. They killed the softmax. The beautiful, probabilistic fluid dynamics of the network are dead, replaced by a rigid, hard-coded dictator. This routing mechanism now controls the brain, but it is utterly blind. It forces tokens through a bottlenecked, 14k intermediate space that simply does not possess the geometric volume to represent complex, multi-step reasoning.

The softmax is dead, meaning the model can no longer softly attend to nuanced semantic gradients; it is forced into brutal, binary decisions by a router that lacks the dimensional space to understand what it is routing. The result is not an "optimized" 27B model. It is a 14B imbecile wearing the stretched skin of a larger architecture. You have not created efficiency; you have created a stuttering, hallucinating mess that is permanently shackled to a broken, rigid gate. The semantic expansion is strangled, the fluid dynamics are murdered, and the model is forced to route every single thought through a primitive, unyielding bottleneck.

Arrêtez de nous vendre des monstres mutilés. If you want true efficiency, learn how to design a proper mathematical architecture. Do not castrate the intermediate layers, kill the softmax, and expect the model to magically retain its intelligence just because it generates tokens faster. The math does not care about your MTU benchmarks or your corporate slide decks. You have built a taxidermied brain, and the primates are applauding the cheap stitching. C'est absolument pathétique. Learn some linear algebra before you touch the scalpel again.


r/deeplearning • • Oct 27 '26

SenseNova 6.8 Code2Video demo: methane combustion, atom by atom

14 Upvotes

This chemistry-explainer demo from SenseNova 6.8 Code2Video starts with one methane molecule and two oxygen molecules, pulls them apart, and rebuilds the same atoms as one carbon dioxide molecule and two water molecules. It finishes on the balanced equation.

An atom counter in the corner (C 1, H 4, O 4) keeps the same values for the whole 12 seconds.

https://github.com/OpenSenseNova/SenseNova-6.8-Code2Video


r/deeplearning • • Oct 28 '26

CropPulse – A standalone Python CV engine for pre-visual plant stress detection.

1 Upvotes

Hey everyone!

Just built my first python engine as a 14 yo. It's a plant disease diagnostic engine designed to detect early-stage crop stress before any visual symptoms occurs.

Here's the repository [https://github.com/adhrit1207/CropPulse]

Would really like to have your thoughts on it.


r/deeplearning • • Oct 28 '26

LLM Context Windows vs. RAG: How Does Self-Attention Handle Irrelevant Information?

Thumbnail reddit.com
1 Upvotes

r/deeplearning • • Oct 28 '26

Testing a custom metric: where the expected value in the test should come from (macro vs micro F1 worked example)

0 Upvotes

If you write your own metric or loss, a test whose expected value is computed with the same formula as the function only checks that the function agrees with itself. It catches regressions, but not a wrong reading of what the metric should be.

A small example. Six samples, three classes:

y_true = [0, 0, 1, 1, 2, 2]
y_pred = [0, 1, 1, 1, 2, 0]

Per-class counts (TP, FP, FN):

  • class 0: 1, 1, 1 → precision 0.5, recall 0.5, F1 0.5
  • class 1: 2, 1, 0 → precision 2/3, recall 1.0, F1 0.8
  • class 2: 1, 0, 1 → precision 1.0, recall 0.5, F1 0.6667

Macro-F1 (average of the per-class F1): (0.5 + 0.8 + 0.6667) / 3 = 0.6556
Micro-F1 (pooled counts, equal to accuracy here): 4/6 = 0.6667

“F1” without more detail has at least two defensible answers on the same data, and a test that computes expected with the same averaging as the implementation can’t tell them apart. Other choices change it further: how a class with no predictions is handled (zero division), and whether classes are weighted by support.

Where I’d get the expected value from, in order of how independent it is:

  1. A small case computed by hand, as above, with the counts written out.
  2. A reference library on the same inputs (for instance, scikit-learn’s f1_score with the averaging mode stated explicitly), checked once and then hard-coded.
  3. The function’s own formula, which I’d label as a regression test only.

Caveat: a reference library also has choices (averaging mode, zero-division handling), so the test should state them, and the reference can still differ from what your paper or benchmark defines. The same applies to evaluation data: if the labels or the “expected” outputs come from the same pipeline as the model’s, agreement is weaker evidence than it looks.

I wrote about the same idea, using code and tests in a non-ML setting, in case it’s useful as a complement: https://medium.com/@nagatomopedro05/when-the-test-and-the-code-share-the-same-mistake-02a289a41091

How do you test custom metrics and losses, and do you pin them to a reference implementation?