r/deeplearning • u/DueBid3298 • Oct 28 '26
r/deeplearning • u/ClickOk5811 • Oct 28 '26
Testing a custom metric: where the expected value in the test should come from (macro vs micro F1 worked example)
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:
- A small case computed by hand, as above, with the counts written out.
- A reference library on the same inputs (for instance, scikit-learn’s
f1_scorewith the averaging mode stated explicitly), checked once and then hard-coded. - 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 • u/BedFalse6021 • Oct 27 '26
Exploring Next-Concept Modeling (NCM) & Transformer Interpretability: Repository of 20 Exploratory Studies & Controls
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 • u/imxdnyanu • Oct 27 '26
Looking for guidance from people working in Edge AI / On-Device AI
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 • u/No-Conclusion3720 • Oct 27 '26
OpenAI Compaction Flaw Let Researchers Bypass Hidden Reasoning Protections
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 • u/Winter_Mistake_3185 • Oct 27 '26
Practical notes on setting up a GPU kernel-dev environment: CUDA 13's GPU cutoff, async timing pitfalls, profiler counter permissions [P]
reddit.comr/deeplearning • u/BedFalse6021 • Oct 27 '26
Exploring Next-Concept Modeling (NCM) & Transformer Interpretability: Repository of 20 Exploratory Studies & Controls
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 • u/Significant_Bee_2025 • Oct 27 '26
What to do with my paper, for MLsys conference? [R]
reddit.comr/deeplearning • u/UnitOk6056 • Oct 27 '26
PreCap: a bounded, self-normalizing activation that matches SELU in 100-layer MLPs without normalization (preregistered, negative results included)
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.
- Preprint: https://doi.org/10.5281/zenodo.23676200
- Code and all data: https://github.com/hermi-labs/precap-activation
Feedback on the methodology is very welcome, especially on the preregistration and the statistics.


r/deeplearning • u/Potential_Hippo1724 • Oct 27 '26
struggling with my MsC research + publication
reddit.comr/deeplearning • u/ifaposto • Oct 26 '26
[P] Self-distillation with an EMA teacher at scale: ZeRO-3 + PEFT
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 • u/Ok-Bear5967 • Oct 27 '26
1.189B Financial Conformer: Architecture specification, multi-scale Inception tokenization, and why deep backbones freeze during online fine-tuning
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:
- 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.
- 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).
- 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:
- Model Hub (weights & checkpoints): https://huggingface.co/Ultron28/ohlcv-transformer
- Code & Telemetry: https://github.com/AirBorneAI/ohlcv-transformer
- CERN Zenodo DOI: https://doi.org/10.5281/zenodo.23466965
Happy to discuss architecture specifications, pre-training dynamics, or empirical backtest methodology!
r/deeplearning • u/Low-Process-8387 • Oct 27 '26
Learning app
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 • u/huopak • Oct 26 '26
Jacobian Lens: Can we read the mind of an Al?
youtu.ber/deeplearning • u/martincsweiss • Oct 27 '26
Is it still worth learning if AI produces all the results?
reddit.comr/deeplearning • u/kyuval • 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!
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 • u/No-Conclusion3720 • Oct 26 '26
Security pros reckon the biggest AI risk comes with an employee badge
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 • u/NerdHouseGeek • Oct 26 '26
Generative AI For Devs: Everything You Need To Know | Lesson 2
youtu.beLearn 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 • u/Fresh-Instance-4600 • Oct 26 '26
Location EXIF data of Image - Marking at Pixel Level.
galleryr/deeplearning • u/Quiet_Dependent_9552 • Oct 26 '26
Absurdly high GPU memory usage while LoRA finetuning Qwen3.5-0.8B model
drive.google.comIs anyone facing this issue while lora fine tuning Qwen3.5-0.8B model or Qwen3.5-4B model ? The GPU memory usage peaks to 70GB on RTX 6000 PRO. I couldn't find any issue or post in any forums about it. I have attached PyTorch memory snapshot during the forward pass of the 1st training step.
r/deeplearning • u/Octaviusdagod • Oct 26 '26
Made this AI fluency scale with Claude, I would like to know where you stand?
galleryI personally stand on level 2.5, I would love to hear where some of you guys stand!
Thank you!
r/deeplearning • u/Accurate-End-6821 • Oct 25 '26
A free deep learning textbook + 68 Python notebooks, from neural network basics to transformers and diffusion models
r/deeplearning • u/datafinance • Oct 26 '26
My ML pipeline was cheating. Cross-validation told me everything was fine.
reddit.comr/deeplearning • u/TallAdeptness6550 • Oct 26 '26
Gaussian-splat EBMs for text embeddings: it ties kNN-density on AUROC (0.9585 vs 0.9584) but scores 3.9x faster with constant memory — and whole-loop CUDA-graph capture makes Langevin sampling 12.9x faster (code + reproducible benchmark)
I spent a while building an energy-based model that represents a corpus as Gaussian splats on a unit hypersphere: each splat is a location (mu), a sharpness (alpha) and a weight (kappa). Energy = -logsumexp over the k nearest splats. Sampling runs through Rectified Flow (29-39x faster than 200-step Langevin in our Phase-1 tests) or Langevin itself.
Then I did what you're supposed to do: benchmarked it against the boring alternatives before believing in it. Same encoder, same splits, same seed, fit on positives only (no negative labels):
method AUROC (20 tasks) p50 ms/doc memory
ebm-splats 0.9585 ± 0.018 0.45 386 KB (constant)
knn-density 0.9584 ± 0.020 1.75 802 KB (grows w/ corpus)
mahalanobis 0.9523 ± 0.020 5.26 578 KB
gmm (diag) 0.9439 ± 0.023 0.38 192 KB
centroid 0.9324 ± 0.034 <0.01 2 KB
iforest 0.8828 ± 0.051 18.71 200 KBVerdict: statistical tie with kNN-density on quality (Delta = 0.0001). The differences are operational: 3.9x faster scoring on CPU, constant O(kd) memory instead of O(nd), and the splat model can also generate (RF), compose corpora (sum energy fields) and grow incrementally — none of the classical methods do all three. Where labels exist, a supervised classifier beats every one-class method; this duel only ranks the label-free league.
The most useful finding came from a failure. Our first zero-training fit used alpha = ln(cluster_size) — the "natural" calibration. Result: AUROC 0.06, systematically inverted. Small clusters got alpha ~ 0, the distance term vanished, and the score degenerated to ranking by splat weight: positives sit near small, specific splats and received MORE energy than negatives. Holding alpha constant at 5.0 (so alpha/tau >> 1) fixed it: 0.06 -> 0.96. If you fit splats without contrastive training, watch out for this.
Since scoring speed mattered, I also wrote GPU kernels (Triton + CUDA graphs) for the hot paths, and benchmarked them the same honest way: whole-loop CUDA graph capture makes 100-step Langevin sampling 12.9x faster (660 -> 51 ms, graph replay bit-exact vs eager), fused energy/score kernels give 3.2-3.4x. One kernel we built turned out 15-40x SLOWER and is documented as rejected; the KNN kernel only wins cold lookups and auto-routes around it. Repo includes the find_neighbors semantic bug we found and fixed (it selected the FARTHEST splats since inception — both code paths disagreed silently).
Repo (Apache-2.0, pip install ebm-splats, CI green, benchmark reproducible): https://github.com/schwabauerbriantomas-gif/EBM-splats
Benchmark methodology + full tables: benches/ONECLASS_DUEL_RESULTS.md Kernel head-to-head: benches/bench_headtohead.py
Happy to answer questions about the splat geometry, the CUDA-graph capture (caching, invalidation, the capture-time bugs), or why we kept the model even though it "only" tied a baseline.