TokenScope: Token-Level Explainability and Interpretability for Code-Oriented Tasks in Large Language Models

Amirreza Esmaeili, Fatemeh Fard
4/30/2026
cs.CLcs.AIcs.SE

No confident code implementation found for this paper.

Abstract

Understanding how Large Language Models (LLMs) make token-level decisions during code generation remains a major challenge for both researchers and practitioners. While recent tools provide insights into model internals or generation outcomes, they often lack decoding-time signals, fine-grained uncertainty measures, and interactive mechanisms for exploring alternative generation paths.

Show full abstract

We present TokenScope, an interactive interpretability and analysis tool for decoder-based LLMs that exposes token-level metrics, attention patterns, and structural information during generation. TokenScope supports interactive token replacement, counterfactual branching, and code-aware aggregation via abstract syntax trees. By unifying decoding-time signals with structural program analysis, TokenScope enables systematic investigation of LLM behaviour during code generation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{esmaeili2026tokenscope,
  title  = {TokenScope: Token-Level Explainability and Interpretability for Code-Oriented Tasks in Large Language Models},
  author = {Amirreza Esmaeili and Fatemeh Fard},
  year   = {2026},
  eprint = {2607.01235},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.01235v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.01235.svg)](https://codeofpaper.com/paper/2607.01235)

Discussion