Can LLMs Compress (and Decompress)? Evaluating Code Understanding and Execution via Invertibility
Paper · 2026 · Nickil Maveli, Antonio Vergari and Shay B Cohen
Summary
Code-LLMs perform well on benchmarks that check execution in one direction, but it is unclear whether their forward and backward reasoning about the same program agree. The authors present RoundTripCodeEval (RTCE), which treats code understanding as an inversion problem. It uses four lossless compression algorithms (RLE, LZW, Huffman and AE) with 250 real-world inputs per algorithm, written in Python. Models must carry out four related tasks:
- predict the encoder output from the input,
- predict the decoder output from the compressed data,
- invert the encoder,
- invert the decoder.
Scoring uses exact match without running code, and a sample counts as consistent only if the reconstruction equals the original input. The authors evaluate open-source Code-LLMs under three strategies: prompting without examples, fine-tuning on execution traces in a supervised way, and repeated rounds of self-reflection. None of these approaches closes the gap. Models often solve the forward and backward tasks separately yet fail the full round trip. Both fine-tuning and self-reflection plateau after one revision round, and errors appear even on simple bijections like RLE. This suggests current models lack the coherent internal model of program state needed for reliable bidirectional code reasoning.
Key points
- RTCE contains 1,000 exact-match instances (4 algorithms × 250 inputs). It is execution-free and limited to Python. Code and data are released at github.com/Nickil21/round-trip-code-compression.
- The four tasks are Output Prediction, Input Prediction, and their "with Inversion" variants. Together they form a round-trip check of whether dec(enc(x)) = x.
- SFT used LoRA on QwQ-32B, the strongest zero-shot model:
- Setup: rank-8 adapters on all linear modules, 3 epochs, effective batch size 32, learning rate 1e-4 with a cosine schedule, and one adapter per algorithm.
- Gains: forward-task Pass@5 rose to about 80% for RLE, 87.5% for LZW and 78.6% for AE.
- After fine-tuning, the gains were lopsided. Huffman output-side tasks stayed at 0% while its decoder side reached 35%, and the AE input-side scores fell to around 20–31%.
- Compared with earlier benchmarks such as IdentityChain, RTC, CRUXEval, CodeIO and CodeMind, RTCE is the only one that requires exact enc/dec bijection, including explicit inversion.
Institutions
Fields, topics and concepts
📚 Shelves 6The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 worksInformation Systems · 1,437 worksComputer Science Applications · 102 works
🧭 Topics 2Research subjects and languages the work is about.Language models & pretraining · 3,320 worksEvaluation & benchmarks · 1,220 works
Cite
Cite as Nickil Maveli, Antonio Vergari and Shay B Cohen. 2026. Can LLMs Compress (and Decompress)? Evaluating Code Understanding and Execution via Invertibility. Findings of the Association for Computational Linguistics: ACL 2026.
@inproceedings{maveli2026can,
title = {{Can LLMs Compress (and Decompress)? Evaluating Code Understanding and Execution via Invertibility}},
author = {Nickil Maveli, Antonio Vergari and Shay B Cohen},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2026},
year = {2026},
doi = {10.18653/v1/2026.findings-acl.1279},
url = {https://doi.org/10.18653/v1/2026.findings-acl.1279}
}References
- Miltiadis Allamanis, Sheena Panthaplackel, and Pengcheng Yin. 2024. Unsupervised evaluation of code LLMs with round-trip correctness. In Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pages 1050–1066. PMLR. find
- Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, and Hannaneh Hajishirzi. 2024. Self-RAG: Learning to retrieve, generate, and critique through self-reflection. In The Twelfth International Conference on Learning Representations.
- Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, and 1 others. 2021. Program synthesis with large language models. ArXiv preprint, abs/2108.07732.
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/maveli-2026-can-llms-compress-decompress-evaluating/