arXiv:2610.29767cs.CLOct 2026

Manuscript Offprint

arXiv:2610.29767

ALIAS: Evaluating Performance and Memorization in LLM-Written TLA+ Specifications

Arslan Bisharat, Mujtaba Nazari, Khushboo Bhadauria, Brian Ortiz, Eric Spencer, Beatriz Santos, TaiNing Wang, George K. Thiruvathukal, Konstantin Laufer, Mohammed Abuhamad

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Memorization inflates the benchmark scores of large language models, since a model can reproduce answers it saw in training. Researchers test for it with consistent identifier renaming (CIR), which gives every identifier in a task a new name, and treat a lower score on the renamed task as evidence of recall. We test this method on the Temporal Logic of Actions Plus (TLA +^{+}) language, whose model checker acts as an oracle by confirming whether a renamed task keeps the exact behaviors of the original. Across 111 TLA +^{+}-Bench tasks, renaming lowers the correctness of Claude Opus 4.8 from 28% to 18% and of GPT-5 from 9% to 7%. Most of this decrease comes from how the test grades, which requires exact names that most descriptions never state. Grading by behavior shrinks the decrease to about 3 points for Opus 4.8 and to 0 for GPT-5. In two model families fine-tuned on disjoint halves of the tasks, renaming removes about half of the training gain in likelihood and costs 4.9 points (Qwen) and 1.3 points (Gemma) on unseen tasks. A lower score after renaming therefore mixes memorization, name-based grading and the cost of new names.

1 Introduction

TLA +^{+} is a formal specification language engineers use to find design errors in concurrent and distributed systems before they build them, and Amazon Web Services has reported subtle bugs found this way in DynamoDB and S3 (Newcombe et al., 2015). A TLA +^{+} specification describes the possible behaviors of a system, and the TLC model checker explores every reachable state and checks the properties that a configuration file lists by name (Lamport, 2002; Yu et al., 1999). Writing a correct specification takes time and expertise, so LLMs that write specifications from natural-language descriptions could help more engineers use the method. Benchmarks measure this by checking each generated specification with the TLA +^{+} parser SANY and the model checker TLC (Cheng et al., 2026; Bisharat et al., 2026a,b).

TLA +^{+}-Bench and FormaLLM take their TLA +^{+} specifications from public repositories on GitHub (Bisharat et al., 2026a,b), so a model under test may have been trained on the specifications in these benchmarks, and a score may then measure recall as well as skill. Coding models memorize parts of their training data (Yang et al., 2024) and score higher on problems that resemble their training examples (Riddell et al., 2024; Matton et al., 2024). Public TLA +^{+} data is scarce, since TLA +^{+}-Bench collects 1,614 candidate specifications from 13 repositories (Bisharat et al., 2026b), and it is unknown whether models recall these few specifications. Likelihood-based detectors perform near chance on training and held-out data from the same distribution (Shi et al., 2024; Duan et al., 2024), so researchers rename every identifier of a task consistently and compare the scores on the original and renamed tasks (Wang et al., 2023; Le et al., 2025; De Koning et al., 2026; Gulati et al., 2025; Mirzadeh et al., 2025; Li, 2026; Yang et al., 2026; Spencer et al., 2026). We call this consistent identifier renaming (CIR), because each identifier gets one new name everywhere it appears. The test assumes that the renamed task is as hard as the original, so a lower score after CIR is read as evidence of memorization. We study this test on TLA +^{+}, because TLC can confirm that a renamed task keeps the behaviors of the original and can grade an answer by behavior.

We investigate memorization in LLM-written TLA +^{+} through three experiments on 111 TLA +^{+}-Bench tasks whose renamed copies pass SANY and TLC. Experiment 1 grades the outputs of Claude Opus 4.8 (Anthropic, 2026) and GPT-5 (OpenAI, 2025) the way TLA +^{+}-Bench grades them, with the configuration file of the reference specification, which often requires names that the description

Figure

Figure 1: The Barrier task as the model receives it, with the configuration that checks the output. Renamed parts are shaded, and the description states neither required name.

never states (illustrated in Figure 1). Experiment 2 fine-tunes two copies each of Qwen2.5-Coder-14B and Gemma 4 31B on disjoint halves of the tasks, so each task is seen by one copy and unseen by the other, and compares the renaming decrease on seen and unseen tasks. Experiment 3 grades the outputs of Experiment 1 again by behavior, which ignores names. Together, the experiments show that a lower score after renaming has three possible causes, ① memorization of the original task, ② a grading practice that requires names the model is never given and ③ the extra difficulty of working with unfamiliar random names. This paper makes four contributions. ① We show that much of the decrease after CIR on TLA +^{+}-Bench comes from the grading procedure. ② We separate memorization from the cost of CIR with controlled fine-tuning on disjoint halves of the tasks, so the training exposure of every task is known. ③ We measure the decrease after CIR with a grade that checks behavior and ignores names. ④ We give recommendations for contamination tests and benchmark builders, and we release ALIAS, with the renamed tasks, the exposure split, all model outputs and the behavior-based grader. 1^{1}