# EsoLang-Bench: Evaluating Large Language Models via Esoteric Programming Languages

*Aman Sharma, Paras Chopra*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/139789) · [Open on the map](../papers.html#p139789)

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [Software Engineering Benchmarks](../pgroup/646.md) · Type: benchmark or dataset · Keywords: esoteric programming languages, LLM evaluation, out-of-distribution generalization, code generation, benchmark

Areas: [Code & Coding Agents](../areas/codegen.md) › Code Verification › Coding agent benchmarks; [Multilingual](../areas/multilingual.md) › Cross-Lingual Methods › Cross-lingual evaluation; [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Software Engineering Benchmarks; [Benchmarks for LLMs & Agents](../areas/bench-llm-agents.md) › Cross-Domain Agent Evaluation › Software Engineering Benchmarks

## Summary
EsoLang-Bench introduces a benchmark of five esoteric programming languages to measure how well frontier large language models generalize algorithmic problem-solving to programming languages outside their training distribution.

## Explained to a 5-year-old
Some smart computers called large language models are really good at solving puzzles written in normal computer languages like Python. The researchers made a new test that uses five very strange programming languages that almost nobody uses. They asked the computers to solve the same puzzles in those strange languages and found the computers did much worse. This helps see how well the computers can think when they see something they have never seen before. The test is useful because it shows where the computers still need to get smarter.

## Explained to a 5-year-old, longer
Large language models are computer programs that can write code and answer questions. They are especially good at solving problems written in common programming languages like Python. The researchers wanted to see how well these models could handle languages that are not common. They chose five programming languages that are very unusual and hard to understand, like Brainfuck and Shakespeare. These languages are still able to solve any problem, but they look completely different from normal code. The researchers created a test that includes the same problems in both normal languages and these unusual ones. When they asked the models to solve the problems in the normal languages, the models got almost all answers right. However, when the same problems were written in the unusual languages, the models got very few answers correct. Even when the models were shown examples of how to solve the problems, they still struggled with the strange languages. This shows that the models rely a lot on having seen the language before, rather than truly understanding how to solve problems. The new test helps scientists find out where the models need to improve so they can work better with new and unfamiliar situations. It also gives a safe way to test computers without worrying that the test data might have been seen before.

## For a technical reader
The paper introduces EsoLang-Bench, a benchmark comprising five esoteric programming languages (Brainfuck, Befunge-98, Whitespace, Unlambda, and Shakespeare) that are Turing complete but rarely appear in training corpora. By evaluating frontier large language models on algorithmic problems expressed in these languages, the authors quantify the performance drop when models encounter out-of-distribution code. Results show near-perfect accuracy on Python/JavaScript equivalents (≈100%) while esoteric versions achieve only 0-11% accuracy, and standard prompting strategies such as few-shot or self-reflection do not close the gap. The benchmark is contamination-resistant because esoteric languages have negligible deployment value and minimal representation in public repositories, making it a reliable proxy for true generalization. This work highlights the need for evaluation suites that test algorithmic reasoning beyond the languages models have over-exposed to during pre-training and post-training.

## Problem
Large language models excel on popular programming languages like Python and JavaScript, but it is unclear how they perform on programming languages that are rarely seen during training. This paper addresses the problem of evaluating LLM generalization to out-of-distribution, unfamiliar programming languages.

## Method
The authors construct a benchmark comprising five esoteric programming languages (Brainfuck, Befunge-98, Whitespace, Unlambda, and Shakespeare) and evaluate frontier models across multiple prompting strategies. They assess performance on algorithmic problems expressed in these languages, comparing results to the same problems in Python/JavaScript.

## Results
The evaluation reveals a dramatic capability gap: while Python/JavaScript problems achieve near-100% accuracy, the esoteric versions score only 0-11% across frontier models, and few-shot or self-reflection prompting does not close this gap.

## Contributions
The paper provides a contamination-resistant benchmark for measuring out-of-distribution algorithmic generalization of LLMs and demonstrates the extent of the performance drop on unfamiliar languages. It also offers an empirical analysis of prompting strategies on esoteric code tasks.

## Practical relevance
Provides a robust, contamination-resistant benchmark to guide the development of more broadly generalizable language models for code.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/139789)
