Skip to content

ICML papers

Search ICML papers by title, author, or track. Open a paper’s abstract to read more.

Explore the ICML analysis

Search results

461–480 of 823

  • ICML · Workshop · 4th Structured Probabilistic Inference & Generative Modeling

    Time-Annealed Perturbation Sampling: Diverse Generation for Diffusion Language Models

    Jingxuan Wu, Zhenglin Wan, Yuzhe YANG, Yiqiao Huang, Chubin Zhang, Xingrui Yu, Ivor Tsang, Yang You

    Abstract

    Diffusion language models (Diffusion-LMs) generate text through iterative denoising, exposing a temporal structure that is largely absent from autoregressive decoding. In this paper, we show that this temporal structure provides a useful control axis for generation diversity: early denoising steps mainly determine high-level semantic trajectories, while later steps refine lexical realization. Motivated by this observation, we propose Time-Annealed Perturbation Sampling (TAPS), a training-free inference strategy that samples nearby conditioning trajectories through time-aware, manifold-constrained perturbations. TAPS encourages semantic branching during early denoising and anneals the perturbation away before refinement, improving exploration while preserving prompt alignment, generation quality, and reasoning ability. Experiments on multiple Diffusion-LM backbones, including non-autoregressive and semi-autoregressive models, show that TAPS consistently improves semantic and lexical diversity across open-ended and instruction-following generation tasks, while preserving reasoning ability on verifiable reasoning benchmarks with negligible overhead.

    Abstract source
  • ICML · Workshop · 4th Structured Probabilistic Inference & Generative Modeling

    Internal Data Repetition Destroys Language Models

    Jessica Chudnovsky, Joshua Kazdan, Noam Levi, Rylan Schaeffer, Yegor Denisov-Blanch, Sanmi Koyejo, David Donoho

    Abstract

    Language models are running out of high-quality training data, and even aggressively deduplicated corpora retain some amount of repetition. Earlier controlled studies predated Chinchilla-style scaling laws and could only measure the cost of repetition indirectly. We revisit repetition in the Chinchilla-style scaling regime, using a fitted no-repetition scaling law to report Compute-Equivalent Gain and Compute-Equivalent Loss. We show that repetition damage in this modernized regime is systematic in three ways. First, eval loss is worst at an intermediate repeat count $R$, so repeating a moderately sized subset many times hurts more than either repeating a large subset a few times or a small subset many times. Second, the location of this peak is well fit by a power law in model size. Finally, when repeated documents make up 10% of training tokens in a controlled exact-document repetition setting, the compute-equivalent loss can be large: on FineWeb-Edu-Dedup, the most damaging repeat count for a Qwen3-style 344M-parameter model at OT=1 matches the loss of a no-repetition run using about 67% of the FLOPs, under our fitted no-repetition scaling law. A misspecified linear regression with verbatim duplicates reproduces the same qualitative non-monotonicity in closed form, suggesting that such peaks can arise from a statistical tradeoff between memorization and generalization. Our findings give practitioners a way to predict which settings waste the most compute before they spend any of it.

    Abstract source
  • ICML · Workshop · 4th Structured Probabilistic Inference & Generative Modeling

    Conditional Inference Mismatch in Structured Diffusion Language Models

    Matevz Matjasec

    Abstract

    Structured diffusion language models are trained by denoising partially observed sequences, often with access to both past and future context. Many downstream uses, however, require prefix-conditioned inference: predict the next answer from a prompt while future tokens are latent. We study this train/test conditional mismatch as a probabilistic inference problem. The core observation is an entropy gap: future-conditioned denoising conditionals are lower-uncertainty than the causal prefix-conditioned marginal required at test time, and recovering the latter requires marginalizing over exponentially many latent futures. Iterative denoising is an approximate inference procedure for this marginalization, but can amplify uncertainty when it conditions on model generated futures. We support this with one-step conditional likelihood diagnostics, full denoising traces, and controlled synthetic tasks. Finally, we introduce a simple structured corruption prior for masked diffusion LMs: mask later positions more often, so training more frequently denoises suffix tokens from cleaner prefixes while retaining the same tractable tokenwise diffusion-ELBO form for the modified process. The intervention partially reduces the uncertainty gap and improves context-conditioned prediction, suggesting that objective structure is an important inductive bias for prefix-conditioned inference.

    Abstract source
  • ICML · Workshop · Culture x AI: Evaluating AI as a Cultural Technology

    What Do Historical Language Models Model?

    Thierry Poibeau

    Abstract

    Historical language models are increasingly used to infer attitudes, beliefs, or viewpoints from past societies. This paper argues that such uses rest on fragile epistemic assumptions. We show that historical language models do not simulate past minds or populations, but instead model the structure of surviving textual archives, which are shaped by systematic biases of literacy, genre, and preservation. By introducing a validity ladder that distinguishes textual, discursive, and population-level claims, we provide a framework for evaluating what kinds of historical inferences these models can legitimately support. This perspective clarifies how historical language models can contribute to research in the social sciences and humanities without encouraging overinterpretation.

    Abstract source
  • ICML · Workshop · Culture x AI: Evaluating AI as a Cultural Technology

    Code-Switching Reveals Anchor Bias in Multilingual Large Language Models

    Jeonghyun Park, Seunghyun Yoon, Hwanhee Lee

    Abstract

    Multilingual Large Language Models (MLLMs) are increasingly expected to handle inputs with multiple languages across diverse contexts. However, it remains unclear how MLLMs internally organize code-switching (CS), a multilingual practice where speakers alternate between languages within a single interaction. In this paper, we use CS Question Answering (QA) as a controlled setting to probe language anchoring in MLLMs. Following common English--target-language evaluation settings, we treat English as the source and the paired non-English language as the target. We introduce anchor bias, a representation-level measure that assesses whether a CS hidden state is closer to its source or target-language counterpart. Across various MLLMs, we observe a consistent pattern: source-framed CS is more strongly anchored toward the source side, whereas target-framed CS is anchored toward the target side. This representational preference is reflected in QA behavior, where source-anchored inputs suffer smaller performance drops. We also verify that in MoE models, this anchoring appears not only in hidden-state geometry but also in sparse computational pathways. By quantifying how grammatical frames dominate internal organization, our work provides an interpretive framework for evaluating the linguistic sensitivity of MLLMs in mixed-language settings.

    Abstract source
  • ICML · Workshop · Culture x AI: Evaluating AI as a Cultural Technology

    When East Asia Loses Its Names: Interpreting Neighborhood Effect and Cultural Generalization in Vision-Language Models

    Youngsik Yun, Yusang Cho, Jihie Kim

    Abstract

    Large vision-language models (LVLMs) perform well across multimodal tasks but still struggle with fine-grained cultural recognition among cul- turally similar countries. In this paper, we analyze the Neighborhood Effect, a cultural misidentifi- cation pattern in which artifacts from relatively un- derrepresented countries are interpreted as belong- ing to culturally similar but more dominant neigh- boring countries. We collect images of cultural ar- tifacts centered on centered on China, Japan, and Korea, and analyze the generated captions at both the word and token-probability levels. Word-level analysis shows that LVLMs often omit national- level cultural identities and shift underrepresented artifacts toward dominant neighboring cultures or broader labels such as “Asian,” a pattern we call Cultural Generalization. Token-probability analysis suggests that direct misidentification as a specific neighboring country is tied to early Vision Encoder or multimodal representation er- rors, whereas Cultural Generalization is more fre- quently associated with Mutation Layers in the later LLM stage under cultural uncertainty. These findings clarify how fine-grained cultural recog- nition failures in LVLMs emerge and take shape among culturally similar countries.

    Abstract source
  • ICML · Workshop · High Dimensional Learning Dynamics: the Science of Scaling

    RRD: Routing-and-Residual Distillation for Efficient MoE Recovery in Large Language Models

    Hoyoon Byun, Kangjun Noh, Somin Kim, Heedong Kim, Jaeyoon Shim, Sungjun Lim, Youngjun Choi, Kyungwoo Song

    Abstract

    Mixture-of-Experts (MoE) architectures improve inference efficiency by activating only a small subset of parameters for each token. Recent dense-to-MoE conversion methods transform pretrained dense large language models into sparse MoEs through expert initialization, but practical top-$K$ routing prevents the converted model from fully reproducing the original dense computation. We view this recovery gap as arising from two coupled challenges: selecting appropriate experts and recovering information missed by the selected experts. We propose \emph{Routing-and-Residual Distillation} (RRD), a teacher-guided framework that distills routing targets from the original dense model and repurposes shared experts to recover the remaining representation gap. Experiments demonstrate that teacher-guided routing substantially improves sparse MoE recovery and that combining routing and residual recovery yields more faithful dense-to-MoE transfer.\footnote[1]{Code: \url{https://github.com/MLAI-Yonsei/routing_and_residual_distillation}}

    Abstract source
  • ICML · Workshop · High Dimensional Learning Dynamics: the Science of Scaling

    Task-Dependent Inference-Compute Scaling Frontiers: Diffusion vs. Autoregressive Language Models

    Khurram Khalil, Ripan K Kundu

    Abstract

    Scaling test-time compute is a critical driver of language model performance, yet current empirical scaling laws primarily characterize discrete autoregressive (AR) architectures. Diffusion language models (DLMs) construct outputs via high-dimensional, continuous iterative denoising, presenting a fundamentally different generation dynamic. However, it is unknown how their quality-vs.-compute scaling frontiers compare to AR models at matched inference FLOPs. We systematically benchmark inference-compute scaling curves of AR (Qwen2.5) and DLMs (Dream, LLaDA) across sequential reasoning and constraint-satisfaction workloads, moving beyond parameter-count comparisons to rigorously track per-candidate FLOPs. Our results reveal a sharp, task-dependent double dissociation. On constraint-satisfaction tasks (evaluated via Pass@$N$), AR generation quickly saturates at $\sim$31\% accuracy, whereas DLMs' holistic state-space traversal avoids early-commitment traps, scaling smoothly to 98.7\%. Conversely, on sequential chain-of-thought reasoning (GSM8K via majority vote), AR scales highly efficiently to 97.1\%, maintaining $>$10$\times$ per-FLOP efficiency advantage over DLMs. % Broader Impact These findings demonstrate that test-time scaling limits are inherently dictated by interplay between task structure and high-dimensional generation dynamics. This provides first unified scaling perspective across AR and DLM paradigms and motivates task-aware inference routing.

    Abstract source
  • ICML · Workshop · High Dimensional Learning Dynamics: the Science of Scaling

    Layer Collapse in Diffusion Language Models

    Alexander Conzelmann, Albert Catalan-Tatjer, Shiwei Liu

    Abstract

    Diffusion language models (DLMs) have emerged as competitive alternatives to autoregressive (AR) language models, yet their activation dynamics remain poorly understood. We characterize these dynamics in LLaDA-8B and identify a striking layer-collapse property: a few early layers exhibit highly similar, collapsed activation patterns dominated by a single large super-outlier that persists across all token positions. Despite its apparent redundancy, pruning this outlier collapses the model into repetitive token loops. Apart from this outlier, LLaDA-8B is more redundant than comparable AR models, with redundancy concentrated in earlier layers, the reverse of the AR pattern, where deeper layers are usually more redundant due to undertraining. Weight spectral analysis attributes this to relative overtraining of early layers, and a controlled 160M AR/DLM pre-training pair reproduces the pattern, isolating the diffusion objective as the cause.

    Abstract source
  • ICML · Workshop · High Dimensional Learning Dynamics: the Science of Scaling

    Internal Data Repetition Destroys Language Models

    Jessica Chudnovsky, Joshua Kazdan, Noam Levi, Rylan Schaeffer, Yegor Denisov-Blanch, Sanmi Koyejo, David Donoho

    Abstract

    Language models are running out of high-quality training data, and even aggressively deduplicated corpora retain some amount of repetition. Earlier controlled studies predated Chinchilla-style scaling laws and could only measure the cost of repetition indirectly. We revisit repetition in the Chinchilla-style scaling regime, using a fitted no-repetition scaling law to report Compute-Equivalent Gain and Compute-Equivalent Loss. We show that repetition damage in this modernized regime is systematic in three ways. First, eval loss is worst at an intermediate repeat count $R$, so repeating a moderately sized subset many times hurts more than either repeating a large subset a few times or a small subset many times. Second, the location of this peak is well fit by a power law in model size. Finally, when repeated documents make up 10% of training tokens in a controlled exact-document repetition setting, the compute-equivalent loss can be large: on FineWeb-Edu-Dedup, the most damaging repeat count for a Qwen3-style 344M-parameter model at $OT=1$ matches the loss of a no-repetition run using about 67% of the FLOPs, under our fitted no-repetition scaling law. A misspecified linear regression with verbatim duplicates reproduces the same qualitative non-monotonicity in closed form, suggesting that such peaks can arise from a statistical tradeoff between memorization and generalization. Our findings give practitioners a way to predict which settings waste the most compute before they spend any of it.

    Abstract source
  • ICML · Workshop · High Dimensional Learning Dynamics: the Science of Scaling

    Matching Features, Not Tokens: Energy-Based Fine-Tuning of Language Models

    Samy Jelassi, Mujin Kwun, Rosie Zhao, Yuanzhi Li, Nicolò Fusi, Yilun Du, Sham Kakade, Carles Domingo i Enrich

    Abstract

    Cross-entropy (CE) training provides dense and scalable supervision for language models, but it optimizes next-token prediction under teacher forcing rather than sequence-level behavior under model rollouts. We introduce a feature-matching objective for language-model fine-tuning that targets sequence-level statistics of the completion distribution, providing dense semantic feedback without requiring a task-specific verifier or preference model. To optimize this objective efficiently, we propose energy-based fine-tuning (EBFT), which uses strided block-parallel sampling to generate multiple rollouts from nested prefixes concurrently, batches feature extraction over these rollouts, and uses the resulting embeddings to perform an on-policy policy-gradient update. We present a theoretical perspective connecting EBFT to KL-regularized feature-matching and energy-based modeling. Empirically, across Q&A coding, unstructured coding, and translation, EBFT matches RLVR and outperforms SFT on downstream accuracy while achieving a lower validation cross-entropy than both methods.

    Abstract source
  • ICML · Workshop · Graph Foundation Models: A New Era for Graph Machine Learning

    LoReC: Rethinking Large Language Models for Graph Data Analysis

    Hongyu Zhan, Qixin Wang, Yusen Tan, Haitao YU, Jingbo Zhou, Shuai Chen, Jia Li, Xiao Tan, Jun Xia

    Abstract

    The advent of Large Language Models (LLMs) has fundamentally reshaped the way we interact with graphs, giving rise to a new paradigm called GraphLLM. As revealed in recent studies, graph learning can benefit from LLMs. However, we observe limited benefits when we directly utilize LLMs to make predictions for graph-related tasks within GraphLLM paradigm, which even yields suboptimal results compared to conventional GNN-based approaches. Through in-depth analysis, we find this failure can be attributed to LLMs' limited capability for processing graph data and their tendency to overlook graph information. To address this issue, we propose LoReC (Look, Remember, and Contrast), a novel plug-and-play method for GraphLLM paradigm, which enhances LLM's understanding of graph data through three stages: (1) Look: redistributing attention to graph; (2) Remember: re-injecting graph information into the Feed-Forward Network (FFN); (3) Contrast: rectifying the vanilla logits produced in the decoding process. Extensive experiments demonstrate that LoReC brings notable improvements over current GraphLLM methods and outperforms GNN-based approaches across diverse datasets. The implementation is available at https://anonymous.4open.science/r/LoReC-63F4.

    Abstract source
  • ICML · Workshop · Graph Foundation Models: A New Era for Graph Machine Learning

    Providing Context: Enriching Graph Learning Using Language Model Priors

    Ziv Mor, Roy Mahlab, Moshe Eliasof, Chaim Baskin

    Abstract

    We introduce GINAT, a graph-language augmentation framework that improves message-passing GNNs by conditioning their edge messages on LM-embedded global graph descriptions. Unlike text-attributed graph methods that rely on node/edge-attached text, GINAT leverages external prompts that capture graph semantics independently of the downstream task. These prompts are injected into message passing through a cross-attention mechanism that preserves permutation equivariance, enabling global contextual guidance within standard MPNN computation. Across a broad suite of node- and graph-level benchmarks, GINAT yields consistent gains over strong GNN baselines, reaching up to 23% relative improvement. Ablations show that the gains arise from the semantic content of prompts rather than random vectors, and an analysis of the learned context scaling reveals where and how strongly different backbones and layers rely on language-conditioned information. Overall, GINAT establishes LM-embedded prompts as a practical, interpretable graph-language signal to strengthen graph representation learning. Our code is available at https://anonymous.4open.science/r/llm4gfm-3FBE/

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    Where’s the Plan? Locating Latent Planning in Language Models with Lightweight Mechanistic Interventions

    Nicole H. Ma, Nick Rui

    Abstract

    We study $\textit{planning site formation}$ in language models---$\textit{where}$ internal representations of structurally-constrained future tokens form during the forward pass, and whether they causally drive generation. Using rhyming-couplet completion as a clean test of forward-looking constraint, we apply two lightweight methods (linear probing and activation patching) across Qwen3, Gemma-3, and Llama-3 at more than ten scales. Probing shows that future-rhyme information is linearly decodable at the line boundary, with signal that strengthens with scale in all three families. Activation patching reveals that only Gemma-3-27B causally relies on this encoding, exhibiting a $\textit{handoff}$ in which the causal driver migrates from the rhyme word to the line boundary around layer 30. Every other model we test conditions on the rhyme word throughout generation, with near-zero causal effect at the line boundary despite strong probe signal. We localize the Gemma-3-27B handoff to five attention heads through two-stage path patching that recover ~${90}$% of the rhyme-routing capacity at the newline.

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    Task-Aligned Stability Analysis of Vision-Language Models for Autonomous Driving Hazard Detection

    Everett Richards

    Abstract

    Vision-language models (VLMs) are increasingly used for scene understanding in autonomous driving, but robustness analysis often relies on task-agnostic embedding stability alone. We study whether corruption-induced embedding drift predicts changes in a task-aligned hazard score derived from CLIP image-text similarities. Using controlled corruptions on BDD100K road scenes, we compare embedding drift against margin drift, defined as the change in hazard score under perturbation. The relationship is highly corruption-dependent: some families exhibit strong coupling between representation drift and decision drift, while others induce hazardous decision instability despite relatively modest embedding change. A scatter analysis reveals a structured upper envelope relating margin drift to embedding drift, suggesting that representation change constrains but does not determine decision instability. These results suggest that robustness benchmarks should include task-aligned stability measures in addition to embedding-level perturbation statistics.

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    Internal Data Repetition Destroys Language Models

    Jessica Chudnovsky, Joshua Kazdan, Noam Levi, Rylan Schaeffer, Yegor Denisov-Blanch, Sanmi Koyejo, David Donoho

    Abstract

    Language models are running out of high-quality training data, and even aggressively deduplicated corpora retain some amount of repetition. Earlier controlled studies predated Chinchilla-style scaling laws and could only measure the cost of repetition indirectly. We revisit repetition in the Chinchilla-style scaling regime, using a fitted no-repetition scaling law to report Compute-Equivalent Gain and Compute-Equivalent Loss. We show that repetition damage in this modernized regime is systematic in three ways. First, eval loss is worst at an intermediate repeat count $R$, so repeating a moderately sized subset many times hurts more than either repeating a large subset a few times or a small subset many times. Second, the location of this peak is well fit by a power law in model size. Finally, when repeated documents make up 10% of training tokens in a controlled exact-document repetition setting, the compute-equivalent loss can be large: on FineWeb-Edu-Dedup, the most damaging repeat count for a Qwen3-style 344M-parameter model at $OT=1$ matches the loss of a no-repetition run using about 67% of the FLOPs, under our fitted no-repetition scaling law. A misspecified linear regression with verbatim duplicates reproduces the same qualitative non-monotonicity in closed form, suggesting that such peaks can arise from a statistical tradeoff between memorization and generalization. Our findings give practitioners a way to predict which settings waste the most compute before they spend any of it.

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    Functional Subspace, where language models can use vector algebra to solve problems

    Jung H Lee, Sujith Vijayan

    Abstract

    Large language models (LLMs) were invented for natural language tasks such as translation, but they have proved that they can perform highly complex functions across domains. Additionally, they have been thought to develop new skills without being trained on them. These learning capabilities lead to LLMs adoption in a wide range of domains. Thus, it is imperative that we understand their operating mechanisms and limitations for proper diagnostics and repair. The earlier studies proposed that high level concepts are encoded as linear directions in LLMs activation space and that the geometry of embeddings have semantic meanings. Inspired by these studies, we hypothesize that LLMs may use subspaces and vector algebra in subspaces to perform tasks. To address this hypothesis, we analyze LLMs' functional modules and residual streams collected from LLMs engaging in in-context learning (ICL), one of the emergent abilities. Our analyses suggest that 1) LLMs can create subspaces, where evidence can be accumulated and 2) ICL tasks can be solved via simple algebraic operations in subspaces.

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    Stress Tests REVEAL Fragile Temporal and Visual Grounding in Video-Language Models

    Sethuraman T V, Savya Khosla, Aditi Tiwari, Vidya Ganesh, Rakshana Jayaprakash, Aditya Jain, Vignesh Srinivasakumar, Onkar Susladkar, Joey Wang, Srinidhi Sunkara, Aditya Shanmugham, Abbaas Alif Mohamed Nishar, Rakesh Vaideeswaran Mahesh, Simon Jenni, Derek Hoiem

    Abstract

    Video-Language Models (VidLMs) achieve strong benchmark scores, yet these scores often hide whether models use the video at all. We show that VidLM failures follow two pathways: some visual signals are never reliably encoded, while others are encoded but overridden by model priors. We introduce REVEAL, a diagnostic stress-test benchmark for quantifying when and why VidLMs under-use visual evidence. REVEAL contains five controlled probes: camera-motion sensitivity, cross-frame integration, video sycophancy, language-only shortcuts, and temporal expectation bias. Together, they test whether models encode basic video signals, combine evidence across frames, and preserve visual evidence against user assertions, language cues, and learned event expectations. Across 11 VidLMs, we find systematic failures along both pathways. Under assertive prompts, several models produce near-identical outputs for real videos and random noise, making visual evidence effectively causally inert. We further carry out mechanistic probes to identify where these failures arise in the model pipeline and why visual evidence is lost. REVEAL provides a scalable, human-verified framework for moving beyond aggregate scores toward structured, reproducible evaluation of multimodal reliability.

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    Spectral Signatures of Large Language Models

    Zhuoying Zhang, Ishan V Prasad, Zihang Liu, Yuanzhe Hu, HENGRUI LUO, Pu Ren, Yaoqing Yang

    Abstract

    The rapidly growing repository of publicly available large language models (LLMs) presents significant challenges for systematic management and quantification at scale, such as model lineage tracing, licensing, and evaluation. However, task-specific benchmarks are insufficient for this setting, as LLMs differ widely in architecture, scale, and training procedures. To address this challenge, we introduce a spectral shape-based metric for managing and quantifying LLMs based on Heavy-Tailed Self-Regularization theory. Our approach uses the shape information of the weight empirical spectral density as a compact spectral signature of each model. This signature captures intrinsic properties of pretrained models and remains robust during post-training, making it suitable for model-level analysis. In addition, the proposed metric is data-free, computationally efficient, and scale-invariant, enabling large-scale analysis in practice. We show that our spectral signature supports tracing model lineage and unsupervised clustering. Overall, the proposed spectral signature provides a meaningful proxy for broad performance trends across LLMs, enabling efficient organization, comparison, and analysis of large model collections.

    Abstract source
  • ICML · Workshop · Combining Theory and Benchmarks: Towards A Virtuous Cycle to Understand and Guarantee Foundation Model Performance

    GraphStateEval: A Step-by-Step Evaluation Framework for Graph Algorithm Execution in Large Language Models via Intermediate State Tracing

    Kanav Kapoor, Dhruv Kumar, Jagat S Challa, Murari Mandal, Yash Sinha

    Abstract

    We introduce GraphStateEval, a step-by-step evaluation framework and benchmark for measuring how accurately large language models (LLMs) execute graph algorithms, requiring models to reproduce complete internal memory states---queue, stack, priority queue, visited set, and neighbour lists---at every loop iteration under zero-shot execution with no teacher forcing or intermediate state corrections. Ground-truth traces are generated deterministically by a programmatic engine with canonical tie-breaking rules, enabling arbitrarily complex, automatically verified benchmarks that resist memorisation and saturation. We evaluate Gemma 3 12B on BFS, DFS, and Dijkstra across five graph topologies scaled from $N{=}3$ to $N{=}12$ nodes using two zero-shot prompting strategies (natural language and source code). Our Step-Exact-Match (SEM) metric reveals a pronounced topology hierarchy: path graphs sustain near-perfect tracing throughout, while sparse-random graphs degrade substantially beyond $N{\approx}6$; conversely, dense-random and complete graphs often maintain surprising resilience up to $N{\approx}10$ due to shallower traversals. All results reflect single-seed evaluation and should be interpreted as exploratory. A persistent gap between SEM and Final-Answer-Correctness (FAC) across BFS, DFS, and Dijkstra illustrates algorithmic reward hacking---where correct final answers are produced despite internally incorrect intermediate state traces---showing that answer-level evaluation can drastically overestimate true step-level algorithmic execution fidelity.

    Abstract source