Role Overview
I was a founding AI researcher at Erdős AI Lab, a research lab started by students, from February to July 2026. The work ranged over continual learning, world models, brain-computer interfaces and neuromorphic computing, but I spent most of my time on one question: what actually limits how much of a big model you can squeeze into a small one.
That question is knowledge distillation. You train a large teacher model, then try to transfer what it knows into a smaller, faster student. In practice the student stops improving well before it matches the teacher, and it is not obvious why. I wrote new distillation algorithms, traced where in the network the transfer breaks down, and built the training and evaluation pipelines to test it at a scale where the answer means something.
What I worked on
-
Knowledge distillation algorithmsI designed and benchmarked distillation strategies for transformer and vision models, comparing student accuracy and generalization.
-
Teacher-Student Model PipelinesI built training, evaluation and ablation pipelines for teacher-student models in supervised and self-supervised settings.
-
Representation Transfer AnalysisI compared representation transfer across layers and modalities to see where distillation worked and where it failed.
-
Efficient DeploymentI worked on deploying compact student models on edge devices and in production, checking accuracy and latency.
Research
Geometric Limits of Knowledge Distillation: A Minimum-Width Theorem via Superposition Theory
Nilesh Sarkar
Status: work in progress - the theory and experiments below are an active research effort; the write-up is still evolving.
Abstract
Knowledge distillation (KD) compresses large teacher models into smaller, deployable student networks. However, student performance consistently saturates at a loss floor that persists regardless of training method, objective function, or hyperparameter tuning. We prove that this floor is geometric in origin, not an artefact of optimisation.
Superposition and capacity limits
Modern neural networks pack far more learned features into their hidden layers than they have dimensions - a phenomenon called superposition. When a teacher with hidden width dT learns N > dT features by encoding them as near-orthogonal directions, a student with width dS < dT can faithfully capture at most dS × g(α) of those features, where g(α) is a geometric packing function determined by the interference tolerance α. Features beyond this capacity are irrecoverably lost, setting a hard floor on distillation fidelity.
The Minimum-Width Theorem
We formalise this as the Minimum-Width Theorem: for a student to achieve loss within ε of the teacher, it must have hidden width at least dmin = N / g(α(ε)). Below this width, no amount of training - longer schedules, better objectives, curriculum strategies - can close the gap. The bound is tight: we construct matching lower-bound examples using sparse-autoencoder (SAE) feature dictionaries extracted from trained transformers.
Experimental Validation
We validate the theory on transformer language models by training SAEs to extract superposed feature dictionaries at each layer. Experiments measure alive-neuron counts, L0 sparsity, feature importance distributions, and per-layer capacity utilisation. The observed loss floors align quantitatively with the geometric predictions, confirming that architecture width - not training recipe - is the binding constraint on distillation quality.
Practical Implications
This research shifts the focus of model compression from "how to train" to "how to design." By estimating a teacher's superposition ratio ($N/d_T$) using Sparse Autoencoders (SAEs), we can determine the smallest viable student architecture ($d_{min}$) before beginning compute-intensive training. This provides a diagnostic tool to visualize exactly which features are "lost" during distillation, bridging hardware efficiency with model transparency.
- Architecture Benchmarking: If a student's width falls below $d_{min}$, further training compute is mathematically wasted.
- Feature Prioritization: When width is constrained, we can use SAE importance distributions to ensure high-value features are preserved.
- Interpretability Link: SAE-based feature extraction diagnoses capacity limits and reveals the specific representational collapse of the student.
Mathematical Framework: The Minimum Width Theorem
For a student model to achieve a loss within $\epsilon$ of its teacher, it must possess a minimum hidden width:
$d_{min} = \frac{N}{g(\alpha(\epsilon))}$
Where $N$ is the number of features in superposition and $g(\alpha)$ is the geometric packing function. Below this width, the student undergoes catastrophic representational collapse.
Experimental results
Reconstruction MSE, the L1 sparsity penalty, and the combined loss across all 24 SAE layers over 300 M training tokens. With L1 held loose at 3e-4 you get the densest activations (avg L0 around 6,184) and the best reconstruction. Each line is a layer, so the smooth simultaneous declines confirm no layer blew up.
A compact summary card with one row per layer and one column per metric (L0, alpha, g(alpha), MSE, and so on). Shade tells you the relative value within the column. This is the at-a-glance shape of the whole trial.
Feature-importance distribution from the earlier Erdős experiments. Tells you how attribution mass spreads across features rather than concentrating in a handful.
Per-layer summary table from the earlier experiments. The same kind of compact metric matrix that the SAE_Premium_Heatmap replaces in the newer work.
Earlier representation-learning experiment: the layer-by-feature heatmap rendered in a high-contrast cyberpunk style. Same shape of analysis as the later SAE heatmaps, just predating the KD framework that organises the new work.
Causal Dimensionality of Transformer Representations: Measurement, Scaling, and Layer Structure
Nilesh Sarkar
Status: work in progress - the write-up is still evolving.
A study of how many causally effective dimensions a transformer's residual stream actually uses - measured via intervention rather than variance. The work tracks how this causal dimensionality scales with model size and how it is distributed layer by layer, connecting representation geometry to mechanistic interpretability.
Erdős AI Lab research spans knowledge distillation, interpretability, agentic AI, and world models, with work that has reached venues such as ICLR, NeurIPS, and ICCV.
SAE Experiments (KD paper)
Sparse Autoencoders (SAEs) are the central interpretability tool for the current knowledge-distillation paper. The work has two halves: a toy-model validation of the KD minimum-width theorem, then a real-LM sweep training 24 SAEs (one per Pythia-410M layer) for 300 M tokens at three different sparsity regimes. The full gallery below shows every figure produced for each trial, with notes on which variants made it into the paper and which did not. Also mirrored on the Interpretability Experiments page.
Experiment 1 - Toy-Model Validation
Before any real LM, a controlled toy environment validates the KD minimum-width theorem: theory predicts the dictionary width d*S at which reconstruction loss bottoms out. All three figures here go into the paper.
Trial A - L1 = 3e-4 fixed (dense regime)
Loosest sparsity. avg L0 ≈ 6,184, α ≈ 0.81, MSE ≈ 0.0019, d*S ≈ 9,963. Useful as a high-reconstruction baseline, not the regime for monosemanticity claims.
Trial B - L1 = 8e-5 fixed (paper-exact)
Tuned so the L1 penalty matches the paper-exact sum formula. Seven rendering variants of the same per-layer measurements - chosen / rejected based on where each surface excels.
Trial C - L1 = 5e-4 adaptive (target L0 ≈ 150)
Adaptive controller converges on L0 ≈ 152, α ≈ 0.994 - very sparse. ~7k dead features per layer but the survivors are doing real monosemantic work. Picked for the paper comparison panel precisely because the controller gives a guaranteed L0 target across trials.
Why these three trials. Together they cover the corners of the sparsity-vs-reconstruction frontier the KD theory predicts: dense (3e-4), paper-exact (8e-5), very-sparse adaptive (5e-4 → L0 = 150). Other L1 settings (1e-4, 2e-4, 7e-4) were piloted but discarded - either redundant with an included trial or far outside the regime where KD applies.
Reproducibility. 144 checkpoints per trial (24 layers × 6 snapshots) are archived so the full training trajectory is recoverable; source on GitHub.