r/deeplearning • • 1h ago

The idea behind Adam Optimizer

Thumbnail youtube.com
• Upvotes

Hi all! I'm AI engineer. This is the first video on my channel. I tried to build Adam from scratch, motivating each step by a concrete problem of the previous one: plain GD, Nesterov, AdaGrad, RMSProp ...

All animations are made with Manim. I'd really appreciate feedback, especially on anything that's mathematically imprecise or unclear.


r/deeplearning • • 1h ago

[R] SANATAN ATTENTION: No Growing KV cache (Standard Attention issue), no context decay (Mamba Issue) binary gate hiding inside i² = −1

Post image
• Upvotes

The idea in one paragraph: over 2x2 real matrices, i² = −1 has two orthogonal solutions, rotation by +90 and −90 degrees:

i₊ = [[0, −1], [1, 0]], i₋ = [[0, 1], [−1, 0]]

Square either one and you get [[−1, 0], [0, −1]] = −I, so both are genuine square roots of minus one. Their combination is

S(θ) = cosθ · i₊ + sinθ · i₋ = [[0, −(cosθ − sinθ)], [cosθ − sinθ, 0]]

whose off-diagonal entry is

±(cosθ − sinθ)

That ± in front is a binary object sitting inside a smooth formula. SANATAN promotes it into an explicit soft variable:

r = tanh( γ ( cos(θ+ω) − sin(θ+ω) ) ) ≈ ±1

Each token projection u becomes an angle θ = π·u / (1 + |u|), every feature dimension softly picks a root, and the six-channel feature map

Φ(x) = [ 1, cosθ, sinθ, r, r·cosθ, r·sinθ ]

makes the attention score factorize exactly:

⟨Φ(q), Φ(k)⟩ = (1 + r_q r_k)(1 + cos Δθ)

a per-dimension parity gate (0 or 2 for hard roots) times an angular similarity. The GIF above walks through it step by step.

Because the score is an inner product, the p=1 case runs as an exact recurrence with a constant-size state, no KV cache and no decay:

S_t = S_{t−1} + Φ(k_t) v_tᵀ, z_t = z_{t−1} + Φ(k_t), out = ⟨Φ(q), S⟩ / ⟨Φ(q), z⟩

What I measured (184M params, single seeded held-out protocol):

- The recurrence is exact in practice, not just on paper: parallel and recurrent computation of the trained model agree within 1e-4 nats (float32). There is a demo notebook that reproduces this on CPU in about two minutes on a small model (agreement ~4e-6 per logit).

- Quality survives the constant state: 3.951 held-out loss recurrent vs 3.966 for its full parallel parent, via a two-stage recipe (sharpened pretraining, brief p=1 adaptation). Deploying p>1-trained models through the recurrence costs ~5 nats, so that path is dead and the paper says so.

- Decode: fixed 14.4 MB state vs a KV cache that hits 2.4 GB at 32K context; 0.153 ms/token flat vs 0.49 to 7.3 ms/token for softmax decoding (3.2x to 48x from 1K to 32K).

- Ablation: the root-parity gate is worth +0.53 nats over the same angular kernel without it.

Paper (PDF): https://github.com/bhargavpatel431997/sanatan-attention/blob/main/paper/sanatan_v2.pdf

Code + runnable demo notebook: https://github.com/bhargavpatel431997/sanatan-attention

Visual explainer of the idea: https://github.com/bhargavpatel431997/sanatan-attention/blob/main/docs/MOTIVATION.md

Independent researcher, single GPU/TPU budget, so critiques and pointers are genuinely welcome, especially from anyone who has tried interaction-level gating inside linear attention before.

Thanks for reading,

Bhargav Patel

https://www.linkedin.com/in/bhargav-patel-63bb27121/


r/deeplearning • • 20h ago

Mamba2-8B compression research series: 27.18 MiB recurrent cache or 3.141 GB stored model data

Thumbnail
3 Upvotes

r/deeplearning • • 20h ago

Neural Networks Are Already Clean -- A Paradigm Shift in Interpretability Research (with interactive visualizations)

Thumbnail already-clean.goodfire.com
2 Upvotes

r/deeplearning • • 1d ago

Why are people so excited about diffusion LMs? What am I missing?

11 Upvotes

I understand the basic idea of generating text through iterative refinement instead of predicting every next token sequentially. It sounds interesting

But when it comes to reasoning. I am not fully convinced.

Autoregressive LLMs can already use chain of thought, RL, multiple sampling attempts and additional test-time compute to improve their answers. What does diffusion fundamentally give us that these models can not achieve?

Is the real advantage better reasoning through global refinement, faster inference, or something else entirely?

I can see the appeal for code, infilling, and structured generation, but I'm curious whether people expect diffusion LMs to beat autoregressive models at general reasoning, too.

Would love to hear arguments from both sides, especially from people who have actually experimented with these models.


r/deeplearning • • 19h ago

Looking for ImageCLEF 2021 DrawnUI Wireframe Dataset

0 Upvotes

Hello everyone!
We are a group of female Computer Science students working on our graduation project.
We are having difficulty finding suitable datasets to train a YOLO model.
We found a dataset called **ImageCLEF 2021 DrawnUI Wireframe Datase https://www.aicrowd.com/challenges/imageclef-2021-drawnui-wireframe?utm\\_source=chatgpt.com\*\*
but unfortunately, it is no longer available for download
**Does anyone have access to this dataset or know how we can obtain it?**
We need it for research purposes only.
Thank you so much to anyone who can help us! ❤️


r/deeplearning • • 17h ago

I Finished This Book In April. The Story Didn't Wait

0 Upvotes

A Forbes analysis published this week found that 79% of organizations are running AI agents in production. Only 2% have identity security tooling to govern them.

That 77-point gap is not a planning failure. It is the normal operational state of enterprise AI right now. Most of those agents carry no declared identity, no defined behavioral scope, and no path to revoke access when something goes wrong. They are already running on production systems that nobody officially registered them to touch.

Shadow IT has always existed. But a misconfigured server sits still. An agent with live access to production data does not.

The discovery problem is upstream of everything else. You cannot scope, audit, or revoke what you have not cataloged. Security teams are already stretched before you add the question of finding agents that were never surfaced through any approval process.

For those of you actually working on this: how are you finding the unsanctioned ones? IAM log analysis, network traffic inspection, developer surveys, something else entirely? And how confident are you that your current method catches agents that were spun up outside the normal provisioning path?


r/deeplearning • • 21h ago

We trained a chest X-ray TB model on a single RTX 3060. It topped Google's published result on one public benchmark and matched it on the other.

Post image
1 Upvotes

We're Mn AI, a two-person startup in Bahrain. No cluster, no big team. Just one RTX 3060 (12 GB) on a desk.

For comparison, Google's published model for this task was built by a Google Health research team on 248,445 X-rays.

We tested ours on the two standard public TB benchmarks from the US National Library of Medicine, the same ones Google reported on:

| Benchmark | Ours (AUC) | Google (AUC) |

|---|---|---|

| Montgomery (138 X-rays) | **0.998** | 0.97 |

| Shenzhen (662 X-rays) | **0.951** | 0.95 |

How we kept it honest:

- Zero benchmark images in training (we ran a duplicate check to make sure)

- Decision threshold locked before testing, on a separate set

- Every image used, no cherry-picking

The benchmarks are free and public. If you want to check our numbers yourself, DM us and we'll give you a free API key to run all 800 images.

Happy to answer anything about the setup, training on a 3060, or the evaluation.


r/deeplearning • • 22h ago

Title: Scaling Laws Be Gone: With the Rise of Agentic AI, Is the New Bottleneck at Inference-time Compute?

Thumbnail
0 Upvotes

r/deeplearning • • 1d ago

Seeking help on my new GNN type system

6 Upvotes

I am searching for answers while exploring graph neural networks, and i'm also searching for people who are willing to look outside of the language model approach to deep learning.

I'm working on a system right now. I have the scripts running functionally as a toy. Because deployment and scalability are difficult without a team and without more information for my system to process to buold relationships.

Would anybody know where to go to find focused deep learning corpora, that is open source and properly filtered?

I am searching for anything I can regarding mathematics, human language including historical incomplete languages, physics and all categories of the science.

I am looking for something dense, educational and clean.


r/deeplearning • • 1d ago

AgentGarten: Code Worlds for Evolving Agents

5 Upvotes

AgentGarten separates interactive-world state from its visual presentation: executable scene code updates persistent state and interaction rules, while a shared neural renderer turns structured geometry conditions into observations. This lets an agent act on video-like inputs without making the simulator’s state depend on generated frames.

The renderer is adapted from a pretrained video model and trained with Adversarial Forcing. A notable component is exact block-by-block replay: it restores gradients through the history used for later predictions while preserving the original attention execution. The reported replay is bitwise identical to the cached rollout; the full-sequence alternative has a 3.99% relative L2 error.

In interactive tasks, pretrained agents refine inherited playbooks across rounds. The paper reports shelter construction by round 4, compared with roughly 25 million episodes in an earlier self-play result, while noting that these are not directly comparable: the agents start with pretrained knowledge and are learning to ground it in this setup. The renderer’s training and history-gradient method seem the most broadly relevant contributions; the agent results depend more heavily on the choice of pretrained model and task.

Full summary on AIModels.fyi

Original paper

Disclosure: AIModels.fyi is my site.


r/deeplearning • • 1d ago

Help

0 Upvotes

I want to build a handwritten mathematical expression predictor, which will predict the mathematical operators and digits and then give me the result as output, currently I am including just 4 basic mathematical operations, I want to add open CV camera feature to that project, how will I add it?


r/deeplearning • • 2d ago

Mixture of experts: how the routing works, when it breaks, and two ways to fix it

53 Upvotes

I've been working on Mixture of experts (MoEs) and sparsity for a few years now, so I thought I'd make a short video explaining how MoE routing works.

For the video I trained a tiny character model with a 32-expert layer three times, on English, Python and arithmetic text.

Run 1, token choice with no balancing loss: a few experts get most of the tokens. Early in training one expert gets 57% of them while 17 of the 32 are barely used.

Run 2, token choice with a load-balancing loss: tokens spread out roughly evenly and every expert gets work.

Run 3, expert choice: each expert picks its own tokens, so the load is perfectly even, but some tokens get picked by no expert and others by several. It also ended with the lowest eval loss of the three.


r/deeplearning • • 1d ago

Built a YOLO26 kitchenware detector that runs on Android. Is this worth putting on my resume for CV/ML roles?

1 Upvotes

I'm a fresher aiming for computer vision and ML engineer roles. I finished a project and I'd like honest feedback on whether it's interview-worthy or not.

What it does: detects 6 kitchenware classes (plate, spoon, fork, knife, cup, glass) in live camera video on an Android phone, fully on-device.

What I did:

- Data (9,400+ images, ~6.5-7 hours total): I labeled it semi-automatically, not by hand-drawing every box.

  1. Ran Grounding DINO on 900 images (150 per class) to generate bounding boxes, then checked and corrected them by eye.
  2. Trained a seed YOLO model on those 900 images and used it to label the remaining images.
  3. Reviewed those labels by eye for missed or wrong boxes, and did the corrections in X-AnyLabeling.
  4. Published the dataset on Kaggle: https://www.kaggle.com/datasets/raunakgola/kitchenware-object-detection-dataset-yolo-format

- Model selection with Optuna: 25 trials, max 15 epochs each, maximizing mAP50-95. Search space:

- model: yolo26n/s, yolo12n/s, yolo11n/s, yolov9t/s, yolov8n/s (10 candidates)

- lr0: 1e-4 to 1e-2 (log scale)

- batch size: 8, 16 or 32 (capped for 24 GB VRAM)

- mosaic: 0.0 to 1.0

- Training: fine-tuned the two models I picked, YOLO26n and YOLO26s, on the full dataset.

- Compute: a RunPod RTX 4090 pod. Optuna, both training runs and the model conversion took about 5 hours in total and cost about $4.5. It saved me a lot of waiting compared with Google Colab.

- Export + quantization: exported to LiteRT and compared formats. Static INT8 was rejected. I went with 8-bit weights and float32 activations (w8a32): mAP50-95 0.9406 at 2.72 MB.

- App: Kotlin app with CameraX and LiteRT, GPU first with CPU fallback. It filters by class, has confidence/IoU sliders, and shows live FPS, latency and RAM. On my one test phone it ran about 10-14 FPS on GPU and about 4-5 FPS on CPU (single readings, not a proper benchmark).

Being upfront: I generated the Android app with an AI coding agent (Claude Code). I directed it and tested it, but I didn't hand-write the Kotlin. The ML side (data, Optuna, training, quantization decision) is my work.

Known weaknesses:

- The 0.94 mAP is on my validation split, not a separate real-world test set.

- The labels (train and val) came from the same semi-automatic pipeline, so the score partly reflects label consistency.

- It misses some objects and sometimes confuses fork and spoon.

- I tested on one phone only.

Repo: https://github.com/raunakgola/Wareye

My questions:

  1. Is this strong enough to help in interviews, or does the AI-built app hurt it?
  2. What would you add or fix first: a held-out real-world test set, error analysis, something else?
  3. Would you rather see more depth on the model side or a hand-written app?

Thanks for any honest feedback.


r/deeplearning • • 1d ago

AI Agents Linked to Tencent Cloud Probed Alibaba's Amap, Researchers Say

5 Upvotes

Researchers tracked more than 2,600 AI agent attempts targeting Alibaba's Amap from Tencent-linked cloud infrastructure. None of the agents had authorization to access that service.

These were not human operators pivoting through tooling. They were autonomous agents running coordinated, repeated reconnaissance against a live production system at machine speed. Human-paced incident response cannot match that cadence.

The exposure here is not a misconfigured firewall or a leaked credential. The agents operated against a production service with no verified identity, no declared scope, and no gate between their initialization and their first outbound request. The target service had no way to distinguish a legitimate automated caller from an adversarial one before the probe landed.

For those running production APIs or services that autonomous agents — not humans, not static service accounts — might reach: what does your authorization boundary actually look like at the moment of first contact? Not at login, not in a post-incident log — at the exact moment an unknown agent makes its first request.


r/deeplearning • • 1d ago

We added numerical outputs to decision models

Post image
4 Upvotes

r/deeplearning • • 1d ago

[Tutorial] Getting Started with Bedrock AgentCore

1 Upvotes

Getting Started with Bedrock AgentCore

https://debuggercafe.com/getting-started-with-bedrock-agentcore/

In this article, we will cover an introduction to Bedrock AgentCore and check the process from creating agents to their deployment.


r/deeplearning • • 2d ago

Best books about building computer vision models from scratch

10 Upvotes

For those who are familiar with the books by Sebastian Raschka (i.e. "Build a LLM/Reasoning Model from Scratch"), do you know of any recent similar books with a focus on computer vision models (e.g. CNNs, ViTs, Swin etc)? I would like to develop a more in depth understanding by building these models from scratch and I think the approach used by Raschka does exactly that for language models. Any recommendations are welcome!


r/deeplearning • • 1d ago

Deep Learning in Biology by Dr. Edo Dotan

Thumbnail youtu.be
1 Upvotes

This video features a talk by Dr. Edo Dotan titled "Deep Learning in Biology," presented to the Allen Discovery Center at Tufts University. The presentation explores the intersection of Artificial Intelligence (AI) and genomics, focusing on how Deep Learning—specifically Transformer architectures—can be applied to biological sequences.

Key Topics Covered:

• Introduction to AI/ML/DL Hierarchy: A breakdown of how Deep Learning resides within Machine Learning, which is a subfield of AI (1:09).
• Data Representation: Discussion on various data types in biology, including graphs, images, text, and, crucially, genomic sequences (5:28).
• The Challenge of Biological Data: Biological sequences like DNA are analyzed similarly to text strings but present unique challenges compared to standard English, such as different hierarchies, structures, and overlapping gene information (7:57).
• Tokenization in Transformers: Dr. Dotan explains the crucial role of tokenization in transformer models and its effect on performance when applied to genomic data (17:13). He highlights the methodology of training models using different approaches like BPE (Byte-Pair Encoding) vs. k-mer tokenization (20:12).
• BetaDescribe: The talk introduces a framework called BetaDescribe, designed for protein sequences (29:05). This model uses a modular architecture (35:46) including a generator, an evaluator, and a controller to provide rich, meaningful descriptions of protein functions.
• Case Studies & Future Paradigms: The presentation concludes with examples of using BetaDescribe to illuminate the "uncharacterized proteome," moving toward a new paradigm of biological annotation and experimental design (48:00).


r/deeplearning • • 1d ago

We gave a decision model anytime reasoning

1 Upvotes

r/deeplearning • • 1d ago

Wikipedia race: Span-02 vs GPT-6 Luna

1 Upvotes

r/deeplearning • • 1d ago

I built a CLI that tells you how efficiently your GPU is actually training your model

Thumbnail
1 Upvotes

r/deeplearning • • 2d ago

I'm learning CNNs, but I'm getting lost in all the technical terms. How can I understand and explain them simply?

Thumbnail
0 Upvotes

r/deeplearning • • 2d ago

I built a simulator with a PPO agent to beat TempleRun on a phone

Thumbnail
1 Upvotes

r/deeplearning • • 2d ago

Does anyone else understand the math of deep learning so well that you could probably do it without using any DL libraries if you had the time and motivation?

33 Upvotes