r/deeplearning • • 3h ago

SteerTTS: 23M-param TTS with hybrid attention + bidirectional Mamba-3 blocks and masked AdaLN control conditioning

Enable HLS to view with audio, or disable this notification

1 Upvotes

I wanted a small TTS steerable with explicit numeric controls (so an automated response could set prosody per turn), and couldn't find one. Here's what I built and how it's conditioned.

Architecture:

  • FastPitch-style explicit-variance model: phonemes -> encoder -> duration/pitch/energy predictors -> length regulator -> decoder -> 100-band log-mel -> Vocos (frozen)
  • Each encoder/decoder block: multi-head self-attention → bidirectional Mamba-3 branch (forward + backward layers summed; complex-valued state, trapezoidal discretization) → conv FFN
  • Every LayerNorm is adaptive.
  • The mask matters: a control left out is "unspecified" and the model infers it from voice/tag/text; {"rate": 0} explicitly asks for the voice's neutral rate.
  • Guidance: Render conditioned + unconditioned and extrapolate durations, pitch, energy and mel.
  • Optional flow-matching refiner (ConvNeXt, 10 midpoint steps) for mel detail; a Voicebox-style prompted variant for cloning

Size: 9.6M acoustic + 13.5M Vocos = 23M; refiner adds 17.6M.

Steering results (held-out LibriTTS-R speakers, ±2 SD requests):

  • Loudness, median pitch, H1–H2, tilt: Spearman ρ .87–.97 between request and readback
  • Pause, voicing, CPPS: weak (ρ .46–.79); CPPS leaks into pitch/level about as much as it moves itself
  • Mean gain ~0.5 at s=1; s≈1.5 roughly delivers the requested size, at the cost of more cross-talk WER stays ~1% across all requests

Speed: RTFx 60–80 on an RTX 5070, 4–8 on CPU without the refiner (refiner costs ~12× compute).

No human evals yet, English only, single training seed.

License: weights CC BY-NC 4.0, code MIT.

Model + full eval tables: https://huggingface.co/WhissleAI/steer-tts

Curious whether anyone has compared bidirectional Mamba vs pure attention in small non-autoregressive TTS. I haven't run a clean ablation yet and would like to know what to expect.


r/deeplearning • • 3h ago

Fake Web3 Accelerator Uses npm Packages to Spread Malware and Hijack AI Agent Traffic

0 Upvotes

A fake Web3 accelerator recently distributed malicious npm packages to AI developers by dangling free AI credits as bait. Once installed on Windows and macOS systems, the packages spread infostealers, dropped backdoors, and hijacked outbound AI agent traffic. The model was never touched. The attack lived entirely in the tooling layer.

This matters because agents that load external tools at runtime have no native mechanism to distinguish a legitimate call from one injected by a compromised package. The agent fires the call because the package told it to. By the time traffic is rerouted, the agent has already acted on instructions it had no reason to question.

This attack pattern is not exotic or difficult to replicate. Any npm package with sufficient runtime permissions can intercept or redirect the calls an agent makes. Developers trusting a package to behave as documented have no visibility into what it actually does once it is running inside an agent process.

For those of you deploying agents in production: how are you handling this? Are you auditing packages before they reach agent environments, pinning dependency versions, running agents in isolated execution contexts, restricting outbound call destinations, or something else?


r/deeplearning • • 3h ago

[P] BitLens: Visual profiler for neural network quantization (Outlier ratio Omega, per-layer SQNR,MCU SRAM liveness, and 1-click torchao/ORT/TFLM config export)

1 Upvotes

Link to interactive Web Studio (no install needed): https://bit-lens-v1.vercel.app/

GitHub repository: https://github.com/raidodex/bit-lens

When running Post-Training Quantization (PTQ) on vision models or transformers, a handful of layers with heavy-tailed activation distributions usually dominate the accuracy drop. Instead of running full evaluation loops across dozens of mixed-precision combinations, I built BitLens to inspect layer-wise quantization sensitivity from a single calibration pass.

How it works under the hood:

  • One-Pass Calibration Hooks: Wraps PyTorch (nn.Module) or ONNX graphs to capture 128-bin histograms for weights (symmetric per-channel) and activations (asymmetric per-tensor).
  • Outlier Radar (Omega & Kurtosis): Flags fragile layers using excess kurtosis and the support-aware outlier ratio Omega = absmax / p99.9. For instance, on ViT-Tiny, blocks.11.attn.qkv hits Omega = 240.2x, which stretches asymmetric per-tensor step sizes 4.1x beyond the p99.9 bulk and drops INT8 SQNR to 18.8 dB (and INT4 SQNR to 7.4 dB).
  • Topological Peak SRAM Planner: Alongside static Flash weight footprint, it computes tensor liveness across residual branches to find the exact peak activation memory watermark.
  • Greedy Pareto Auto-Fit Solver: Given a target hardware budget (e.g., STM32H7, ESP32-S3, Cortex-M55, Raspberry Pi Zero 2W), the solver greedily downgrades layers from FP32 -> FP16 -> INT8 -> INT4 based on the smallest SQNR loss per byte saved, while respecting user-pinned layers.
  • 1-Click Code Export: Generates standalone quantization scripts for PyTorch torchao (Int8DynamicActivationInt4WeightConfig / Int8WeightOnlyConfig), ONNX Runtime quantize_static with nodes_to_exclude, and TFLite Micro with a companion C arena header.

You can test the preloaded profiles (MobileNetV3-Small, ResNet-18, ViT-Tiny) in the browser studio or run the Python CLI locally on your own .pt / .onnx checkpoints and drag the resulting .bitlens.json file into the studio.

Feedback and PRs on additional quantization schemes (like group-wise AWQ/GPTQ simulation or SmoothQuant alpha previewing) are very welcome!


r/deeplearning • • 7h ago

Asymmetric multi-head AlphaZero in C++: two kamikaze drones learn a pincer attack via self-play (new in Metis-Core v0.4.0-alpha)

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/deeplearning • • 12h ago

built a neural network from scratch using numpy to understand backpropagation

Post image
0 Upvotes

hey everyone!

recently built a 2 → 3 → 1 XOR neural network using NumPy, without PyTorch or TensorFlow.

wanted to understand backpropagation properly, so I implemented the mathematics and gradient descent manually.

trained it for 5,000 epochs and achieved 4/4 correct classifications.

the repo includes mathematical derivations, training visualizations and 12 editable diagrams.

also wrote a detailed Medium article explaining the process.

GitHub: https://github.com/Vaibh37/Neural-Network

Medium: https://medium.com/@devvaibhav37/building-a-neural-network-from-scratch-the-mathematics-behind-learning-xor-10441e674a69

would appreciate feedback on the implementation. if you find it useful, consider starring the repo 🍀


r/deeplearning • • 16h ago

The Journey into Data Science: Master AI-Assisted Development & Coding (...

Thumbnail youtube.com
0 Upvotes

Stop typing boilerplate code and start designing with AI! 🚀

Learn how to optimize your coding workflow with ChatGPT and GitHub Copilot today.

Check out the full guide on my profile!
#AI #Coding #Tech #DataScience


r/deeplearning • • 22h ago

Self Improvement for AI

Thumbnail
1 Upvotes

r/deeplearning • • 23h ago

why a compressor's error can tell you where data came from

1 Upvotes

I wrote a short technical report and then animated it, hoping it's useful to people learning about autoencoders, OOD detection, or mixture-of-experts.

The idea in three steps:

  1. Prediction ⇔ compression. A model that predicts text well can compress it well.
  2. Corollary: a compressor is only good at the kind of data it was trained on.
  3. So its reconstruction error is a fingerprint. I trained an autoencoder on code that squeezes 512 tokens into 8 vectors. It rebuilds unseen code at 99.47% exact-token accuracy, Wikipedia at 47.76%, and random tokens at 0.57%.

That fingerprint can act as a router between expert models, with no extra gating network to train.

Video: https://www.youtube.com/watch?v=4UhvpIWnOvg Paper: https://arxiv.org/abs/2512.16963


r/deeplearning • • 1d ago

Automatic Model-Agnostic Compression Algorithm

3 Upvotes

I made [Sigularty](https://github.com/DewanshShah/Sigularty), an algorithm that combines multiple compression techniques, takes in any model and chooses which techniques to use, and also finds hyperparameters for a few of the techniques. This is one of my first proper projects, and I would love feedback. It is completely free and open source, and these are a few results the algorithm achieved by itself, without any human fine-tuning

|Model|Acc Drop|Compression Ratio|CQI|Speedup|Size (MB)|Accuracy (%)|Latency (ms)|

|:-|:-|:-|:-|:-|:-|:-|:-|

|`Resnet50`|**2.20%**|**8.00x**|**9.897**|**1.28x**|90.66 -> 11.34|66.60 -> 64.40|6.977 -> 5.451|

|`vit_b_16`|**0.00%**|**4.51×**|**4.526**|**1.00x**|327.59 -> 72.67|77.00 -> 77.00|14.96 -> 14.90|

|`efficientnet_b0`|**2.80%**|**2.61x**|**2.284**|**0.90x**|15.95 -> 6.11|91.80 -> 89.00|8.238 -> 9.124|

|`bert_base`|**4.20%**|**6.61x**|**6.449**|**1.02x**|417.66 -> 67.17|86.20 -> 82.00|10.393 -> 10.209|

|`distilbert`|**5.60%**|**9.55x**|**7.049**|**0.78x**|255.42 -> 26.75|82.40 -> 76.80|5.441 -> 6.957|

|`distilgpt2`|**0.00%**|**2.00x**|**2.903**|**1.45x**|312.48 -> 156.24|87.20 -> 87.20|8.559 -> 5.896|


r/deeplearning • • 1d ago

Week in review: Hidden implant in Ledger wallets linked to $93M theft, 1,500+ npm packages exposed

0 Upvotes

Over 1,500 npm packages were compromised in a supply-chain attack last week, according to Help Net Security. One infected dependency is enough to execute arbitrary code. AI coding agents and automated pipelines pull these packages as trusted dependencies during normal operation. When an agent installs or executes a tampered package, the payload runs with full session permissions. The agent does not know the package is malicious. The tool call that fetches the dependency is the attack surface.

This is no longer just a developer workstation problem. Autonomous agents run these installs without a human in the loop, at scale, across environments.

How are teams actually handling package execution trust in their agent pipelines right now? Allowlists, sandboxing, something else?


r/deeplearning • • 1d ago

Blind review exposed how much our rubric depended on the first score

16 Upvotes

We had 480 model outputs reviewed by 3 people, which gave us 1440 total reviews. With prior scores and comments visible on the 2nd and 3rd passes, the report counted 1022 matching judgments across those 1440 reviews. We treated that as solid inter rater agreement and decided the rubric was stable. The scores matched and our human scoring looked calibrated. The agreement chart looked very pleased with itself.

So we reran the same set as a blind review. Matches dropped to 749 and 96 rows showed different readings of the rubric. Watching agreement fall as soon as the prior comments disappeared was a rough meeting. Removing score visibility made reviewer anchoring hard to ignore. Our rubric calibration had trained people to align with an existing judgment and hidden where the criteria were ambiguous. The adjudication queue now holds cases where 1 reviewer marks partial compliance as pass while another marks it as fail. I’m trying to decide whether those 96 rows need rewritten criteria, more calibration examples or fresh reviewers before we trust the next agreement number. 

How are you separating a stable rubric from reviews that only converge after someone sees the 1st score


r/deeplearning • • 1d ago

From AI anxiety to building my first AI-powered iOS app

Thumbnail
1 Upvotes

r/deeplearning • • 1d ago

TempoPFN: Synthetic Pre-training of Linear RNNs for Zero-shot Time Series Forecasting [R]

Post image
2 Upvotes

r/deeplearning • • 1d ago

Se você se acha inútil, lembre-se disto:

1 Upvotes

Treinei dois modelos de machine learning:

​Um classificador de sentimentos (positivo, negativo e neutro)

​Um classificador de idiomas com suporte para 59 línguas

​O detalhe? Não lembro a acurácia de nenhum dos dois e ainda perdi o dataset que usei. 🤡

​👉 Acesse os modelos aqui:

​🔗 Classificador de Sentimentos: https://huggingface.co/Rafaelvieira432/LANG-10M

​🔗 Classificador de Idiomas (59 línguas): https://huggingface.co/Rafaelvieira432/SENTIMENT-21M


r/deeplearning • • 1d ago

Stationary Alone, Drifting TogetherAdapting to interaction-mediated nonstationarity in multi-agent reinforcement learning.

Enable HLS to view with audio, or disable this notification

5 Upvotes

r/deeplearning • • 1d ago

Local LLMs and LLM Deployment

Thumbnail youtube.com
1 Upvotes

r/deeplearning • • 1d ago

Table detection/structure recognition in PDFs with classical CV only (morphology + LSD, no DL) – open source, looking for feedback & contributors

6 Upvotes

Hey all. I've been working on table extraction from PDFs without any deep learning, and finally open-sourced it. Thought this sub might find the approach interesting (or tear it apart, which is also useful).

The pipeline, roughly:

- Bordered tables: morphological opening with long horizontal/vertical kernels to isolate ruling lines, then contour analysis on the line mask to find table regions.

- Borderless tables: detected from text alignment instead. Words are grouped into phrases and checked for left/centre/right alignment across consecutive lines. When enough rows and columns line up, I draw "pseudo-boundaries" onto the image so the rest of the pipeline treats it like a bordered table.

- Structure: text is masked out first, then LSD (Line Segment Detector) finds segments, which are clustered and merged into a grid. A spanning cell is recovered from missing line segments: if a separator is absent across part of the grid, those cells merge (union-find over the cells).

- Text: for digital PDFs, characters come straight from the PDF text layer and are mapped onto the cell grid, so there are no OCR errors on part numbers. OCR (Tesseract or a plugin engine) only runs on scanned pages.

- Post-processing: nested header detection, key-value vs normal table classification, and merging tables that continue across pages (by matching column widths and headers).

Everything runs on CPU, roughly 0.3–1.5 s/page on a laptop, and every decision traces back to a threshold you can inspect. All pixel thresholds are defined at 300 DPI and scale with resolution.

Where it struggles:

- skewed scans (no de-skewing yet; the line detector only tolerates ~2 px of drift)

- small borderless blocks where a header row can be mistaken for key-value pairs

- wrapped text in borderless cells sometimes splits into extra rows

Contributions very welcome. MIT licensed, no need to ask first, just fork and PR. Some things I'd love help with:

- de-skew estimation (Hough/projection-based) before detection

- evaluating on ICDAR 2013 / PubTables-1M / FinTabNet with GriTS or TEDS; I don't have a proper benchmark yet, and that's the biggest gap

- better row reconstruction for borderless tables with wrapped cells

- plugging in other OCR engines (there's a plugin interface + EasyOCR example)

Repo: https://github.com/shlok-n/spartan · pip install spartan-tables


r/deeplearning • • 1d ago

How it works

Thumbnail gallery
0 Upvotes

r/deeplearning • • 1d ago

GPT-2 KV caching experiment: 1,000x fewer estimated FLOPs, about 6x lower per-token latency

1 Upvotes

I implemented GPT-2 small and KV caching in PyTorch to connect the maths with actual inference measurements. I have written up the experiment as the first post on my new blog.

Setup: NVIDIA A40, fp32 with TF32 disabled, batch size 1, greedy decoding, CUDA synchronization around timings, median of five runs per context length. Pretrained weights were loaded and logits checked against Hugging Face; cached and uncached greedy output matched over 200 tokens.

At context length 1,000, my FLOP estimate falls by 1,000x, while per-token latency goes from 29.69 ms to 4.95 ms. Generating 1,016 tokens takes 14.66 s versus 5.03 s. The cached latency is roughly flat, so I want to profile the remaining overhead rather than assume the cause.

The post also covers why a wrong cache order can pass single-token tests, and how a cuBLAS workspace contaminated my memory baseline. After warmup, requested KV bytes match 72 KiB/token; allocator block sizes still produce a separate hump.

Post: https://angry-kratos.github.io/posts/2026-10-kv-cache/

Code: https://github.com/angry-kratos/angry-kratos.github.io/tree/main/code/kv-cache

I am the author and would welcome methodological criticism. What profiling experiment would you prioritize to separate CPU/kernel-launch overhead from GPU memory traffic here? AI assistance was used for editing and tooling; this is an educational experiment, not a claim of a new caching algorithm.


r/deeplearning • • 1d ago

Training GPT2 on my Golf Simulator Machine

Thumbnail
0 Upvotes

r/deeplearning • • 1d ago

One reference image, any pose: a 6.3M-param network drawing a cartoon character it never trained on (code, weights, live demo)

Enable HLS to view with audio, or disable this notification

4 Upvotes

r/deeplearning • • 2d ago

Why are scalograms smooth? A complete comparison between real and complex wavelets #wavelet #morlet #dualltree #...

Thumbnail youtube.com
1 Upvotes
  • Description: This video explains why the Morlet wavelet produces a smooth energy map based on the principles of phase and amplitude. It also provides a concise overview of the characteristics, applications, and history of real and complex wavelets.

r/deeplearning • • 2d ago

Frontier AI Broke the Vulnerability Math - Security Boulevard

0 Upvotes

Traditional security math assumes you can stack independent controls and multiply down the risk. Frontier AI broke that assumption.

When a large model processes a request, it pulls context from whatever retrieval layer is in scope — documents, records, API responses — including fields that were never supposed to leave their origin system. The model has no concept of data classification. A social security number and a product SKU look identical to it. Output can contain that field verbatim, paraphrased, or reconstructed from inference. None of those surface reliably in DLP rules built for exact-match or structured-transit detection.

Security Boulevard covered the underlying shift this week: AI systems do not fit the attacker-defender math that security teams have built their models on. A single node that is simultaneously a data aggregator, a reasoning engine, and an unstructured output channel breaks the independence assumption that makes multiplicative risk reduction work. Teams running AI in production with real customer data are discovering control blind spots they did not know existed.

For those actually operating AI pipelines with sensitive customer data: where in the stack are you catching PII that enters model context through retrieval? Pre-inference, post-inference, somewhere else entirely — and are your current tools even visible to the model's output stream?


r/deeplearning • • 2d ago

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

Post image
0 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 • • 2d ago

The idea behind Adam Optimizer

Thumbnail youtube.com
23 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.