Skip to content

LensLapse: In-Browser Logit Lens for Interactive Exploration of Language Model Training DynamicsLensLapse: In-Browser Logit Lens for Interactive Exploration of Language Model Training Dynamics

Tatsuki Okada, Yusuke Sakai, Taro Watanabe
Nara Institute of Science and Technology (NAIST)
Hugging Face Daily PapersarXiv:2611.41539Originally published Indexed by this site · 2 days agoTools

Quick read

Interpretability

Based on the paper PDF (AI-generated); refer to the original

The authors propose LensLapse, a browser-side logit lens tool for interactively viewing training checkpoints; on Pythia-70M, fp16 maintains 100% top-1 agreement.

Questions
Existing logit lens work mostly analyzes a single trained model, and tools for public checkpoint suites mostly offer only loss curves and static outputs; viewing token-level internal changes across training time still requires writing custom code.
Methods
LensLapse passes the hidden states of each layer through the final norm and unembedding, displaying predictions as a grid, trajectories, and layer profiles; static JSON and browser ONNX inference support precomputed and free prompts.
Experiments and results
For Pythia-70M, fp16 maintains 100% top-1 agreement at three checkpoints, and int8's final-layer agreement at step 143k is 52% or 71%; the cases show a non-monotonic trajectory of fact acquisition.
Limitations and future work
The authors list tuned-lens support and validation of interpretation reliability across model families as future work; the browser inference benchmark covers only Pythia-14M–160M and does not examine the largest compatible scale or the primary limiting factor.
Experimental setupPythia-14M、Pythia-70M et al. · Pythia checkpoint suite、16 curated prompts et al. · top-1 agreement、final-layer KL et al.
AI summaryLensLapse is an open-source web application that lets users interactively explore, at the token level in the browser, how Transformer predictions evolve across training checkpoints. Logit lens is a standard mechanistic interpretability tool for inspecting Transformer predictions across layers; existing tools typically target a single checkpoint, whereas LensLapse supports interactive exploration of a model's training history. Users can drag a slider to browse public checkpoints from five model families and three multilingual checkpoint suites, observing how the logit lens predictions at each layer and each position evolve from frequency bias to factual knowledge. For browser-compatible models, arbitrary prompts are probed in real time in the browser via local inference, with no server, API key, or hosting cost, and prompts do not leave the user's device; the application also supports local models, so a single pip install lets users explore their own models and training checkpoints. LensLapse uses the MIT license and is permanently hosted at iamtatsuki05.github.io/lenslapse.

LensLapse is an open-source web application that lets users interactively explore, at the token level in the browser, how Transformer predictions evolve across training checkpoints. Logit lens is a standard mechanistic interpretability tool for inspecting Transformer predictions across layers; existing tools typically target a single checkpoint, whereas LensLapse supports interactive exploration of a model's training history. Users can drag a slider to browse public checkpoints from five model families and three multilingual checkpoint suites, observing how the logit lens predictions at each layer and each position evolve from frequency bias to factual knowledge. For browser-compatible models, arbitrary prompts are probed in real time in the browser via local inference, with no server, API key, or hosting cost, and prompts do not leave the user's device; the application also supports local models, so a single pip install lets users explore their own models and training checkpoints. LensLapse uses the MIT license and is permanently hosted at iamtatsuki05.github.io/lenslapse.

Related events and news

1 events · 0 news mentions

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    To address the lack of interactive token-level lens tools for the training process, the authors propose browser-side LensLapse.

    Core question: how can researchers and educators interactively inspect layer-by-layer, position-by-position logit lens predictions at each training checkpoint of a language model without writing their own analysis code?

    • Application scenarios: The authors believe that factual recall, frequency bias, and layer specialization form during training, but logit lens tools almost exclusively analyze the trained model; although checkpoint suites provide training histories, public tools usually offer only scalar loss curves and static output galleries.
    • Shortcomings of existing tools: Hosted lens tools rely on server-side inference, and availability depends on backend maintenance; viewing token-level internal dynamics still requires custom code. The authors believe interactive tools are suitable for live demonstrations, exploratory analysis, and discussing model behavior.
    • Core design observations: Browser-compatible models can run client-side, avoiding server inference; precomputed results and local live inference can serve common prompts and arbitrary prompts, respectively.
    • Proposed system: LensLapse is an MIT-licensed open-source web application that browses checkpoints with a log-scale slider, displays the top-1 prediction for each layer-position in a grid, and plots probability training trajectories; it supports five model families, three multilingual checkpoint suites, and user-local models.
    • Usage and deployment: The hosted version requires no server, API key, or hosting cost, and prompts do not leave the device; a single pip install can start the local application and probe API to analyze one's own models and training checkpoints.
  2. What related research exists?

    Related work is divided into training checkpoint resources, interactive interpretation tools, and analysis of representations during training; this paper combines the training axis with a client-side lens.

    Training history and open model resources

    • logit lens (nostalgebraist, 2020): Inspects vocabulary predictions at each Transformer layer; the authors state that such tools almost exclusively analyze post-training models.
    • Pythia (Biderman et al., 2023): Provides 154 intermediate checkpoints each for 16 models trained on the same ordered data; OLMo (Groeneveld et al., 2024) and LLM360 (Liu et al., 2024) follow the same open philosophy.
    • LLM360 K2 gallery (Liu et al., 2024): Table 1 lists it as a system with a training timeline but no lens-style layer view and no client-side inference.

    Interactive lens and model interpretation systems

    • Tuned Lens Space (Belrose et al., 2023), LM-Debugger (Geva et al., 2022), LM Transparency Tool (Tufanov et al., 2024): Provide lens-style layer-by-layer views and use server-side inference to inspect a single post-training model; Table 1 lists all three as having no training timeline and no client-side inference.
    • Neuronpedia (Lin, 2023): A hosted platform providing SAE features and circuits for post-training models; Table 1 does not mark it as a lens-style layer view.
    • Transformer Explainer (Cho et al., 2026): Runs GPT-2 inference in the browser for teaching, but does not expose layer-by-layer vocabulary predictions; BuildAnLLM (Bhalgat, 2025) provides a local checkpoint viewer for user-trained models, and Table 1 notes that its training axis supports only local checkpoints.

    Training data tracing and representation analysis during training

    • OLMoTrace (Liu et al., 2025): Traces outputs back to training data; Table 1 notes that this is not tracing across training time, and the authors state that it is complementary to this paper's focus on training time.
    • Crosscoder work (Bayazit et al., 2026; Ge et al., 2026): Uses crosscoders to track representation formation during pretraining; LensLapse does not implement crosscoder analysis, but provides browser-based logit-lens visualization across checkpoints.

    Positioning and nature of the comparison: Table 1 compares systems across three columns: lens-style layer view, training-time axis, and client-side inference, and LensLapse is checked in all three; the table note explicitly states that this is only a feature comparison, not a runtime or usability benchmark. The paper has no attack or defense baselines, nor baseline experiments on task datasets.

  3. How does the paper address this problem?

    LensLapse centers on exact lens export and combines static precomputation, real-time browser inference, and local model integration.

    LensLapse converts the layer-by-layer hidden states of each checkpoint into vocabulary predictions, then displays them jointly along three dimensions: training step, layer, and token position; common prompts read static results, while free text runs through all registered checkpoints sequentially on the user's device.

    Interactive views and training timeline

    • Lens grid: Each (layer, position) cell shows the top-1 lens prediction, colored by probability; hovering shows the top-10, and clicking pins a cell. The acquisition map is colored by the time at which each cell first predicts the final answer, and the diff view marks changes relative to a reference checkpoint.
    • Time and trajectories: A log-scaled slider covers the precomputed checkpoints and supports autoplay; the trajectory panel plots the exact probabilities of the final top-3, the gold continuation, and user-added tokens, and provides a top-10 bar race and a p-vs-layer profile.
    • Comparison and reproduction: Compare mode renders a second model's grid in sync; emergence stories provide preset views. Application state is encoded in the URL hash, allowing fixed views to be shared and exported as PNG or PDF.

    Two execution paths

    • Precomputed path: For 16 curated prompts (26 for multilingual models), precomputed with fp32 PyTorch on 38 checkpoints, and 20 for the 160M model; static JSON shards store the top-10 per cell, exact probabilities, and the rank trajectory of target tokens, with no need to download weights.
    • Live path: Free text undergoes only a single forward pass, with no autoregressive generation or KV caching, but iterates over all registered checkpoints. Weights are fetched from Hugging Face and cached by the browser Cache API, using ONNX Runtime Web, preferring WebGPU, falling back to WASM or precomputed-only mode.
    • Client-side computation: Transformers.js handles tokenization; for each checkpoint, a single batched matrix multiplication passes all hidden states through the lens head, and softmax and top-10 are computed in JavaScript. Results are cached in IndexedDB or the server JSON cache.

    Conversion and exactness constraints

    • ONNX graph splitting: The backbone outputs the residual stream after the embedding and after each block, with shape [L+1, T, H]; a separate lens head consists of the final norm and unembedding, avoiding a duplicate unembedding matrix.
    • Avoiding double normalization: The last item of Hugging Face's output_hidden_states has already passed through the final layer norm, so the exporter uses forward hooks to capture the raw output of each block; the paper reports a maximum logit error of 0.59 when directly lensing the last item.
    • Per-checkpoint assertion: The core identity is lens(hL) ≡ model logits, i.e., the last block output passed through the lens should reproduce the model logits. The difference assertion in PyTorch is 0.0; the maximum logit deviation across 60 Pythia fp16 checkpoints is 1.1×10−2.
    • Weight format: Weights are stored as fp16 initializers, converted at session load and computed in fp32; the per-checkpoint file sizes for 14M/70M/160M are 29/142/326 MB respectively.

    Model integration and local deployment

    • Architecture coverage: The converter recognizes the decoder stack, LayerNorm or RMSNorm, and unembedding; GPT-NeoX, GPT-2-style, Llama-style, Mistral-style, and Gemma-style all pass the parity check, and OPT uses an explicit override. Unsupported layouts such as post-norm raise an error at export time.
    • Local and custom suites: lenslapse add-model completes export, parity check, precomputation, and registration, and can integrate Hub suites, a single Hub model, or local Trainer checkpoints; the local service supports offline use, background ONNX conversion, and cross-training tracking.
  4. What experiments did the paper conduct?

    Experiments check numerical fidelity, browser latency, and training cases; on Pythia-70M, fp16 is consistent, while int8 degrades with training.

    Experimental setup

    • Numerical objects: Table 2 compares fp32 ONNX, int8 per-tensor, int8 per-channel, and fp16 on Pythia-70M, using fp32 PyTorch as ground truth; it uses 16 curated prompts, 861 cells per checkpoint, and evaluates steps 8k, 64k, and 143k.
    • Production path verification: WebGPU live probing and an ONNX-free fp32 probe server are each compared against fp32 PyTorch precomputed results on 56 evaluated cells; an fp16 server-side forward pass is also compared.
    • Latency objects: Table 3 covers Pythia-14M, 70M, and 160M, with browsers Chromium, Firefox, and WebKit, and execution backends WebGPU or WASM; the hardware is an M1 Max, and the measurement date is 2026-07-15.
    • Latency protocol: Load includes local checkpoint fetch and session init, and Probe includes forward, lens, and top-10; cold/Cache-API-warm and first/warm are reported, with warm being the mean of 5 runs. Except for the two rows labeled 30-token, 8-token prompts are used, and 4× CPU throttling is tested.
    • Case objects: Four training snapshots and a 38-checkpoint trajectory for Pythia-70M; Figure 2 also compares 14M, 70M, and 160M. Unless otherwise noted, case probabilities are the final-layer lens probability at the last prompt position.
    • Conversion validation: Appendix B performs parity checks on GPT-NeoX, GPT-2, Llama, Mistral, Gemma styles, and OPT; this is a conversion correctness check, not a task performance benchmark.

    Main results

    Swipe horizontally to read the table

    Weight formatstep 8k all/finalstep 64k all/finalstep 143k all/finalBrowser MB
    fp32 ONNX1.00 / 1.001.00 / 1.001.00 / 1.00283
    int8 (tensor).90 / .88.73 / .69.61 / .5271
    int8 (channel).93 / .95.78 / .85.74 / .7172
    fp16 (ours)1.00 / 1.001.00 / 1.001.00 / 1.00142

    According to Table 2; the values are top-1 agreement of Pythia-70M relative to fp32 PyTorch, with 16 prompts and 861 cells per checkpoint.

    • Format choice: Based on this, the authors set fp16 storage with fp32 computation as the default; int8 error is larger at later checkpoints, which the authors link to weight outliers that appear during training.
    • KL and the live path: At step 143k, the mean final-layer KL is 2×10−5 (fp32, fp16), 0.18 (int8 channel), and 0.60 (int8 tensor). WebGPU and the fp32 server both maintain the same top-1 on 56 cells, and the maximum absolute probability difference for WebGPU is 5.5×10−4.
    • Precision counterexample: The fp16 server-side forward pass flips 5 of 56 predictions at step 143k, so low-precision execution is only an explicit opt-in; this differs from the default path of fp16 weight storage with fp32 computation.

    Latency across devices and model sizes

    • Unthrottled results: 8-token warm probes on Chromium and WebKit do not exceed 320 ms for any of the three model sizes. Chromium WebGPU warm Probe is 63/70/134 ms (14M/70M/160M), and WASM is 66/127/316 ms (Table 3).
    • Exceptions and throttling: Firefox WASM's 70M warm Probe is 1399 ms, which the main text describes as about 1.4 s, about 11× that of Chromium-WASM. Under 4× CPU throttling, the authors report that WASM is about 4.2× slower and WebGPU about 3.3× slower.
    • Authors' interpretation: The authors state that WASM latency grows approximately linearly with model size, while WebGPU is sublinear; because top-10 extraction is on the CPU, the WebGPU pipeline still contains a CPU-bound portion.

    Training dynamics cases

    • Non-monotonic fact acquisition: For Pythia-70M, Tokyo is near zero before about step 1k and first becomes top-1 at step 8k; it is top-1 in only 10 of 38 checkpoints, drops to P=0.030 at step 32k, and returns to P=0.082 at step 143k (Section 4.3).
    • Frequency bias and layer differentiation: At step 16, the top-1 p is about 3×10−4; at step 64, five high-frequency predictions account for 67% of all 861 cells in the 16-prompt suite, dropping to 36% at step 512. At step 143k, Tokyo is top-1 only in layers 5–6.
    • Scale differences and forgetting: Paris never becomes top-1 in 14M and 70M, with final P of 0.0012 and 0.0028 respectively; 160M becomes top-1 at step 32k and drops to rank 3, P=0.022, at step 143k. The steps at which Tokyo first becomes top-1 are 72k, 8k, and 32k respectively (14M/70M/160M, Figure 2 and Section 4.3).

    Other ablations and analyses

    • Acquisition order: For code completion, b at step 1k, much and time at 2k and 3k respectively, and Tokyo and Washington at 8k and 32k respectively.
    • Loss after learning: oxygen becomes top-1 at step 8k and loses that position by step 143k; the authors state that Washington shows a similar pattern.
    • Precomputed loading: The authors report that the grid renders on first access within one second; this result is not part of the live-probe latency protocol in Table 3.
    • Interpretive reliability: The authors explicitly state that numerical fidelity is not equivalent to interpretive reliability, and cite the issue that intermediate-layer predictions may be brittle.
  5. What are some points that can be further explored?

    The authors leave interpretation reliability and tuned-lens for follow-up work; performance measurements are limited to three Pythia sizes and the specified browser environment.

    Limitations and future directions noted by the authors

    • Interpretive reliability remains to be verified: Section 4.1 states that numerical fidelity does not establish interpretive reliability, and intermediate-layer predictions may be brittle; tuned-lens support and verification of interpretive reliability across model families remain future work.
    • Browser scale boundaries not examined: Section 3.2 states that the maximum browser-compatible size was not considered, nor was it determined whether the primary limiting factor is download size, memory, or latency.
    • Alternative paths needed when resources are insufficient: Section 3.2 states that precomputed views or a probe server are needed when browser resources are insufficient; free-text tokenization for MAP-Neo and Aquila also requires a server.
    • Scope of browser inference benchmarks: Section 3.2 states that browser inference was benchmarked only for Pythia-14M–160M; out-of-the-box support goes up to Qwen3-0.6B.

    Scope of experimental coverage

    • Numerical fidelity: Table 2 reports only Pythia-70M, 16 prompts, and three checkpoints; agreement between the production browser and the probe server is reported for 56 cells each, and the paper reports no user study or human verification of interpretive conclusions.
    • Latency environment: Table 3 uses one M1 Max, Chromium/Firefox/WebKit, and three Pythia sizes; warm Probe is the mean of 5 runs, and CPU throttling is DevTools emulation.
    • Training cases: The detailed trajectories in Section 4.3 mainly come from Pythia-70M, and the cross-scale comparison in Figure 2 covers 14M, 70M, and 160M; these are representative cases selected by the authors.
    • Architecture validation: Appendix B reports that multiple norm and decoder layouts pass the parity check, and OPT requires a dedicated override; unsupported layouts fail at export time, and the paper does not give their lens results.
  6. Summarize the main content of the paper

    LensLapse turns training checkpoints into browsable lens trajectories and evaluates the system using fidelity, latency, and case experiments.

    LensLapse is an open-source web system for language model training dynamics, aiming to extend layer-by-layer, position-by-position logit lens from a single post-training model to the entire checkpoint history, while reducing the need for self-written code and server dependencies.

    • Method highlights: The exporter captures the raw residual states of each block, forms the lens head from the final norm plus unembedding, and checks per checkpoint the consistency between the last layer and the model logits; the interface links the training slider, prediction grid, probability trajectories, and layer profiles.
    • Execution: Curated prompts use static JSON precomputed with fp32 PyTorch, and free text iterates over checkpoints on-device via ONNX Runtime Web; a local probe server and the add-model workflow support user-trained models.
    • Numerical results: On Pythia-70M with 16 prompts, fp16 weights with fp32 computation maintain 1.00 top-1 agreement at steps 8k, 64k, and 143k; int8 per-tensor's all/final-layer agreement at step 143k is .61/.52 (Table 2).
    • Runtime results: 8-token warm probes on unthrottled Chromium and WebKit do not exceed 320 ms for 14M, 70M, and 160M; Firefox WASM's 70M warm Probe is 1399 ms, an exception listed in the paper (Table 3).
    • Training phenomena: For Pythia-70M, Tokyo first becomes top-1 at step 8k, but remains top-1 in only 10 of 38 checkpoints; Paris becomes top-1 only in 160M at step 32k, then drops to rank 3 by step 143k.
    • Authors' conclusions and boundaries: The authors consider that the system can interactively inspect frequency bias, fact acquisition, layer specialization, and knowledge drift, and is suitable for research, teaching, and communication; they also emphasize that numerical fidelity is not equivalent to interpretive reliability, and tuned-lens and cross-family reliability verification remain to be done.

Research lineage

1 foundations · 0 follow-ups in library
Explore in knowledge graph →
This paper
LensLapse: In-Browser Logit Lens for Interactive Exploration of Language Model Training Dynamics
2026-11-30
Follow-up work

No later in-library follow-ups recorded yet.

Hover or focus a connected paper to inspect the citation context.

Read originalhuggingface.co