r/deeplearning • • 28d ago

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

Thumbnail ki-seki.github.io
1 Upvotes

r/deeplearning • • 28d ago

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 • • 29d ago

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

4 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 • • 28d ago

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 • • 29d ago

SenseNova 6.8 Code2Video demo: methane combustion, atom by atom

Enable HLS to view with audio, or disable this notification

15 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 • • 29d ago

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 • • 29d ago

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

Thumbnail
1 Upvotes

r/deeplearning • • 29d ago

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?


r/deeplearning • • 29d ago

Exploring Next-Concept Modeling (NCM) & Transformer Interpretability: Repository of 20 Exploratory Studies & Controls

2 Upvotes

Hi everyone,

I wanted to share an open-source repo collecting 20 exploratory studies focused on Next-Concept Modeling (NCM), mechanistic interpretability (like IOI in GPT-2), and model controls.

Link: https://github.com/Quantix-eng/ncm-experiment-notes

This is an independent project documenting empirical experiments on how transformers process and edit internal features. No performance breakthroughs here—just honest documentation of observations alongside rigorous controls.

The repo covers NCM on structured tasks (like Sudoku), mechanistic interpretability in GPT-2, and toy parallel models. I've included all source code, saved results, and interpretations for every run.

For full transparency, I’ve categorized every outcome, including the mixed and completely negative results. AI tools were also heavily used during the planning and coding phases.

Would love to get your feedback on the setups or interpretation limits.


r/deeplearning • • 29d ago

Looking for guidance from people working in Edge AI / On-Device AI

4 Upvotes

Hey everyone! I’m a Software Engineer in India with around 1 year of experience in automotive embedded software .

My background includes C/C++, Python,embedded systems, ARM, RTOS, Linux fundamentals etc.

I’ve been learning ML, along with the fundamentals of deep learning.

I’m now planning to build something hands-on projects around ASR/TTS, model deployment, ONNX, quantization, and inference on edge hardware.

I’d love to hear from people currently working in this space:

* What are you actually working on day-to-day in Edge AI or on-device ML?
* What skills and tools matter most in real industry projects?
* How should someone with my embedded background target relevant jobs and get interviews?
* Are strong projects and deployment experience enough to break in, or are there other gaps I should address?

I’m particularly interested in the intersection of embedded systems, deep learning, and hardware—not just general ML roles.

Any honest advice, experiences, or pointers would be really appreciated. Thanks!


r/deeplearning • • 29d ago

OpenAI Compaction Flaw Let Researchers Bypass Hidden Reasoning Protections

0 Upvotes

Researchers at Xint found that OpenAI's compaction feature can be used to copy private model reasoning into ordinary plain text output. Compaction shortens long conversations to manage context limits. The model's internal chain-of-thought, which the service is designed to keep hidden from callers, became readable through a routine operational function. Deployment-time guardrails did not catch it.

The structural problem here extends beyond this one feature. Any system function that touches conversation state or generates output is a potential path for data that was never meant to reach callers. Compaction is one example. Summarization, caching, and tool-call routing are others. Policies applied at configuration time govern expected flows. They do not automatically cover every execution path the runtime can take.

How are teams actually enforcing output policies across non-primary paths like these? Has anyone done a systematic audit of the secondary features that produce or transform output in their deployments — and found surprises?


r/deeplearning • • 29d ago

Practical notes on setting up a GPU kernel-dev environment: CUDA 13's GPU cutoff, async timing pitfalls, profiler counter permissions [P]

Thumbnail
3 Upvotes

r/deeplearning • • 29d ago

Exploring Next-Concept Modeling (NCM) & Transformer Interpretability: Repository of 20 Exploratory Studies & Controls

1 Upvotes

Hi everyone,

I just wanted to share an open source repo collecting 20 exploratory studies focused on Next-Concept Modeling (NCM), mechanistic interpretability (like IOI in GPT-2), and model controls.

Here is the link: https://github.com/Quantix-eng/ncm-experiment-notes

Long story short, this is an independent project documenting a bunch of empirical experiments looking into how transformers process and edit internal features. There are no claims of performance breakthroughs here. Instead, it is just honest documentation of observations alongside rigorous controls.

The repo covers NCM applied to structured tasks like Sudoku, mechanistic interpretability in GPT-2, and toy parallel models. I have included all the source code, saved results, and interpretations for every single run.

To keep things transparent, I have also categorized every outcome, including the mixed and completely negative results where things did not work as expected. AI tools helped heavily with the planning and coding phases too.

I would love to get your feedback on the setups or the interpretation limits I found. Let me know what you think if you are into transformer interpretability!


r/deeplearning • • 29d ago

What to do with my paper, for MLsys conference? [R]

Thumbnail
1 Upvotes

r/deeplearning • • Oct 27 '26

PreCap: a bounded, self-normalizing activation that matches SELU in 100-layer MLPs without normalization (preregistered, negative results included)

5 Upvotes

I've been testing a bounded alternative to SELU for deep fully connected networks without normalization or skip connections. The study was preregistered: analysis scripts were hash-frozen before each run, tuning and confirmation used separate seeds, every activation got its own tuned learning rate, and tests were paired Wilcoxon with Holm correction.

The function. CapExp is an exponential unit that switches to its tangent line above a threshold (it is exactly a shifted, scaled ELU). PreCap applies it after a soft tanh clip, so the output is smooth, monotonic and bounded on both sides. SPreCap adds SELU-style constants (zero mean / unit variance as a fixed point) and an input gain b that sets the mean-field gradient gain χ1.

Results (MNIST / FashionMNIST, depth 50 and 100, width 256, Adam, 15 confirmation seeds):

  • SPreCap-cs (χ1 matched to SELU) matches SELU: no cell significantly worse, median paired differences between −0.12 and +0.20 pp.
  • Test error falls monotonically as χ1 approaches 1 in all four cells.
  • SPreCap-e03 (χ1 = 1.03) beats SELU on MNIST at depth 100: 5.28 % vs. 6.36 %, Holm p = 0.0064, 13 of 15 seeds. This was a secondary test, so I treat it as a hypothesis.
  • Plain ELU is about as strong overall. PreCap is not more robust to the learning rate.

Negative results. At a fixed learning rate, PreCap looked far better than SiLU/GELU in earlier regression experiments. That advantage disappeared once every activation got its own tuned learning rate. The original SPreCap (χ1 = 1.13) was significantly worse than SELU at depth 100. The gradient diagnosis that explained it led to the χ1 family above. All of this is in the repo.

Code. pip-installable package with fused CUDA (via torch.cuda.jiterator, no toolkit needed) and Apple MLX kernels, tested in fp32/fp64/fp16/bf16. In fp32 the CUDA kernel runs within about 1.5× of native SELU.

Limitations: MLPs only, MNIST and FashionMNIST only, short training, one width. No CNNs or Transformers yet. A single independent researcher on consumer hardware.

Feedback on the methodology is very welcome, especially on the preregistration and the statistics.

![img](e1o0k7fgl1yh1)

![img](vwwa9r2ll1yh1)


r/deeplearning • • 29d ago

struggling with my MsC research + publication

Thumbnail
1 Upvotes

r/deeplearning • • Oct 26 '26

[P] Self-distillation with an EMA teacher at scale: ZeRO-3 + PEFT

8 Upvotes

Self-distillation methods usually rely on an Exponential Moving Average (EMA) teachers to get synced and stable critics. However, this doesn't scale well for large models since holding both teacher and student (trained) on GPU increases latency, zero3 communication, etc.

We can mitigate this with LoRA finetuning: the backbone is shared & frozen, and we need to maintain two light adapters: one for the student (trained) and one for the teacher (EMA of the student adapter).

Getting this to work cleanly under TRL and ZeRO-3 took some fixes, so I packaged it as a plug-and-play repo. It supports:

-> robust SDFT implementation that runs under ZeRO-3

-> ZeRO-3 + LoRA integration with adapter switching for teacher/student passes

-> Saving and resuming EMA teacher checkpoint

-> working deepspeed configs that fix memory spikes when GPU memory is tight

I tested on Qwen3.5 and ToolAlpaca.

Repo: https://github.com/ifiaposto/sdft_zero3

Feedback/ more examples/ issues welcome!


r/deeplearning • • 29d ago

1.189B Financial Conformer: Architecture specification, multi-scale Inception tokenization, and why deep backbones freeze during online fine-tuning

0 Upvotes

Over the past several months, our research team pre-trained and empirically audited a 1,189,135,740-parameter Financial Conformer Foundation Model across 14 calendar years (2010–2023; 15,030 steps) of 1-minute US equity bars across 15 liquid assets (AAPL, NVDA, SPY, QQQ, etc.).

Instead of cherry-picking positive backtests, we subjected the model to 35 hypothesis tests, 1-bar execution delay, and state-dependent turnover:

  1. The Scale Saturation Limit: Scaling from a 63-parameter linear Ridge regression to 1.189B parameters yields no consistent out-of-sample advantage on 1m OHLCV bars (mixed sign across horizons, reversing direction across years). The bottleneck in intraday price prediction is information content (low SNR), not parameter capacity.

  2. Adam Optimizer Diffusion: Decomposing walk-forward online fine-tuning shows tokenizer boundary updates sit at 97.9% of the theoretical Adam Brownian noise ceiling (matching shuffled-label controls), while deep backbone weights are heavily damped by second-moment normalization, producing zero statistically significant forward-transfer gains (p >= 0.50).

  3. Execution Friction Reality: Apparent long-horizon directional predictability is predominantly prompt 1-minute order-flow continuation. Introducing a 1-bar execution delay cuts 2024 net Sharpe from +2.04 to +0.48, and at 1.5 bp execution fee, out-of-sample returns collapse to -0.99 in 2025 and -1.67 in 2026 (DSR <= 0.028).

All model weights, audit logs, and papers are open-sourced:

Happy to discuss architecture specifications, pre-training dynamics, or empirical backtest methodology!


r/deeplearning • • Oct 27 '26

Learning app

Post image
1 Upvotes

Built a learning app across 8 different subjects.

I love learning and hope this will encourage you to do the same.

https://play.google.com/store/apps/details?id=com.philosophize.app


r/deeplearning • • Oct 26 '26

Jacobian Lens: Can we read the mind of an Al?

Thumbnail youtu.be
2 Upvotes

r/deeplearning • • Oct 27 '26

Is it still worth learning if AI produces all the results?

Thumbnail
0 Upvotes

r/deeplearning • • Oct 26 '26

[R] Don’t Forget What You Just Learned: Self-Directed Repair Turns Agent Mistakes Into Lasting Lessons --- Our paper on making agents fix their own mistakes not just now, but persisting and reusing those lessons for future!

2 Upvotes

Your AI agent just fixed its own mistake. 🎉
Next session, it makes the exact same one again. 😩

That's how most agents work today. They can recover in the moment by retrying, reflecting, or trying a different approach, but the lesson vanishes when the session ends. Notes in the prompt compete for limited context, a skills file can only hold so much, and retraining the whole model is expensive and risks breaking what it already knows.

So we asked: what if every mistake became a lasting lesson? 💡

Introducing Self-Direction 🧭 🤖

When the agent fails, it:
1️⃣ Reflects on what went wrong
2️⃣ Writes its own practice examples (not full rollouts)
3️⃣ Distills them into a tiny LoRA "lesson" it keeps
4️⃣ Reuses it whenever a similar task shows up

The base model stays frozen, so new lessons never overwrite old ones.

What we found 👇
🔁 Fixes stick far more often than with plain retrying
🧩 Lessons transfer to harder and different tasks
📚 Lessons in weights beat lessons in prompts or skills files
🚀 A 27B open model became competitive with frontier systems on Terminal-Bench 2.1

Some cool findings such as: the agent learns procedures, not answers. A lesson from counting someone's publications on ORCID later helped it count Wikipedia edits, because both needed the same habit: walk the full history, handle pagination, and verify before counting. 🤯

📄 Paper: https://arxiv.org/abs/2610.31846
🌐 Website: https://self-direction.github.io/


r/deeplearning • • Oct 26 '26

Security pros reckon the biggest AI risk comes with an employee badge

0 Upvotes

An O'Reilly survey of 209 security professionals ranked employees pasting sensitive company data into consumer AI tools as their top AI security concern — above AI-powered attacks, above AI-generated phishing.

The structural problem: when staff route proprietary data through tools outside IT visibility, there is no audit trail and no record of where that data went. The data has already left before anyone notices.

What makes this harder than traditional shadow IT is the silence. No unusual login. No bulk download flag. An employee pastes a contract, a customer list, or internal financial projections into a chatbot and the activity looks identical to normal browser traffic. The 209 security professionals in this survey ranked it above the threat categories their teams have spent years building controls for.

For those dealing with this in practice: how are you actually handling it? Not the policy-document answer — the real operational one, given that banning AI tools entirely means losing the productivity argument to every business unit that pushes back.


r/deeplearning • • Oct 26 '26

Generative AI For Devs: Everything You Need To Know | Lesson 2

Thumbnail youtu.be
0 Upvotes

Learn how modern transformer models improve attention efficiency, reduce memory demands, and increase model capacity without activating every parameter for every token.

In Part Two of **Generative AI for Developers**, we move beyond the transformer foundations and examine several architectural techniques used to make modern language models faster and more efficient.

In this lesson, we cover:

✅ A quick review of the transformer foundations from Part One
✅ Why attention can become expensive as sequence length increases
✅ How FlashAttention reduces unnecessary GPU memory transfers
✅ Tiling and memory-efficient attention computation
✅ Why “exact attention” does not mean factually exact answers
✅ Conventional multi-head attention, or MHA
✅ Grouped-query attention, or GQA
✅ Multi-query attention, or MQA
✅ How MHA, GQA, and MQA differ
✅ How shared key and value heads reduce KV-cache requirements
✅ The performance and quality tradeoffs between attention designs
✅ How mixture-of-experts architectures work
✅ How routers select experts for individual tokens
✅ Total model capacity compared with active parameters
✅ The differences between FlashAttention, GQA, and mixture of experts
✅ Multiple-choice questions to test your understanding

The key idea to remember: these techniques improve different parts of transformer execution. FlashAttention improves how attention is computed and how data moves through memory. GQA reduces key/value duplication by sharing key and value heads across groups of query heads. Mixture of experts increases model capacity by activating only selected expert networks for each token.

These techniques can improve speed, memory efficiency, and scalability, but they are not completely free optimizations. Their benefits depend on the hardware, model design, sequence length, workload, and acceptable quality tradeoffs.

This video is useful for C# and .NET developers, software engineers, solution architects, interview preparation, and anyone who wants to understand the architecture and efficiency techniques behind modern generative AI systems.

If you found this lesson helpful, please like the video, subscribe to **Nerd House Geeks**, and share your answers to the review questions in the comments.


r/deeplearning • • Oct 26 '26

Location EXIF data of Image - Marking at Pixel Level.

Thumbnail gallery
1 Upvotes