Can Transformers Break Encryption Schemes via In-Context Learning?
Not on the map. Why?
Abstract (arXiv)
In-context learning (ICL) has emerged as a powerful capability of transformer-based language models, enabling them to perform tasks by conditioning on a small number of examples presented at inference time, without any parameter updates. Prior work has shown that transformers can generalize over simple function classes like linear functions, decision trees, even neural networks, purely from context, focusing on numerical or symbolic reasoning over underlying well-structured functions. Instead, we propose a novel application of ICL into the domain of cryptographic function learning, specifically focusing on ciphers such as mono-alphabetic substitution and Vigen`ere ciphers, two classes of private-key encryption schemes. These ciphers involve a fixed but hidden bijective mapping between plain text and cipher text characters. Given a small set of (cipher text, plain text) pairs, the goal is for the model to infer the underlying substitution and decode a new cipher text word. This setting poses a structured inference challenge, which is well-suited for evaluating the inductive biases and generalization capabilities of transformers under the ICL paradigm. Code is available at https://github.com/adistomar/CS182-project.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 11 of its 25 references that are in the map. First posted on arXiv 13 Aug 2025.
Builds on
11 of 25 references.
References · 11
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
- 2022General-Purpose In-Context Learning by Meta-Learning Transformerscited by 105
- 2025Can Transformers Learn Full Bayesian Inference in Context?cited by 31
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 22
- 2025CipherBank: Exploring the Boundary of LLM Reasoning Capabilities through Cryptography Challengescited by 11
- 2020Can Sequence-to-Sequence Models Crack Substitution Ciphers?cited by 9
- 2025Cryptanalysis via Machine Learning Based Information Theoretic Metricscited by 4
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025ALICE: An Interpretable Neural Architecture for Generalization in Substitution Ciphers
- 2025Benchmarking Large Language Models for Cryptanalysis and Side-Channel Vulnerabilities
- 2023Inhibitor Transformers and Gated RNNs for Torus Efficient Fully Homomorphic Encryption
- 2024Locally Differentially Private In-Context Learning
- 2024Data Poisoning for In-context Learning
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learning
- 2023The Transient Nature of Emergent In-Context Learning in Transformers
- 2024Interpreting Affine Recurrence Learning in GPT-style Transformers