paper-with-me

Papers

Learning Pseudorandom Numbers with Transformers: Permuted Congruential Generators, Curricula, and Interpretability

2025-10-30 · Tao Tao, Maissam Barkeshli arxiv

We study the ability of Transformer models to learn sequences generated by Permuted Congruential Generators (PCGs), a widely used family of pseudo-random number generators (PRNGs). PCGs introduce substantial additional difficulty over linear congruential generators (LCGs) by applying a series of bit-wise shifts, XORs, rotations and truncations to the hidden state. We show that Transformers can nevertheless successfully perform in-context prediction on unseen sequences from diverse PCG variants, in tasks that are beyond published classical attacks. In our experiments we scale moduli up to $2^{22}$ using up to $50$ million model parameters and datasets with up to $5$ billion tokens. Surprisingly, we find even when the output is truncated to a single bit, it can be reliably predicted by the model. When multiple distinct PRNGs are presented together during training, the model can jointly learn them, identifying structures from different permutations. We demonstrate a scaling law with modulus $m$: the number of in-context sequence elements required for near-perfect prediction grows as $\sqrt{m}$. For larger moduli, optimization enters extended stagnation phases; in our experiments, learning moduli $m \geq 2^{20}$ requires incorporating training data from smaller moduli, demonstrating a critical necessity for curriculum learning. Finally, we analyze embedding layers and uncover a novel clustering phenomenon: the top principal components spontaneously group the integer inputs into bitwise rotationally-invariant clusters, revealing how representations can transfer from smaller to larger moduli.

📄 PDF Abstract BibTeX arXiv:2510.26792

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Transformers in Pseudo-Random Number Generation: A Dual Perspective on Theory and Practice

2025-08-02 · Ran Li, Lingshu Zeng arxiv

Pseudo-random number generators (PRNGs) are high-nonlinear processes, and they are key blocks in optimization of Large language models. Transformers excel at processing complex nonlinear relationships. Thus it is reasona…

(How) Can Transformers Predict Pseudo-Random Numbers?

2025-02-14 · Tao Tao, Darshil Doshi, Dayal Singh Kalra, Tianyu He 외

Transformers excel at discovering patterns in sequential data, yet their fundamental limitations and learning mechanisms remain crucial topics of investigation. In this paper, we study the ability of Transformers to lear…

Machine Learning Cryptanalysis of a Quantum Random Number Generator

2019-05-07 · Nhan Duy Truong, Jing Yan Haw, Syed Muhamad Assad, Ping Koy Lam 외

Random number generators (RNGs) that are crucial for cryptographic applications have been the subject of adversarial attacks. These attacks exploit environmental information to predict generated random numbers that are s…

BenchmarkingBIG-bench Machine LearningCryptanalysis

Brains and pseudorandom generators

2013-11-26 · Vašek Chvátal, Mark Goldsmith, Nan Yang

In a pioneering classic, Warren McCulloch and Walter Pitts proposed a model of the central nervous system; motivated by EEG recordings of normal brain activity, Chv\' atal and Goldsmith asked whether or not this model ca…

EEGElectroencephalogram (EEG)

The Effects of Quantum Randomness on a System Exhibiting Computational Creativity

2020-08-22 · Azlan Iqbal

We present experimental results on the effects of using quantum or 'truly' random numbers, as opposed to pseudorandom numbers, in a system that exhibits computational creativity (given its ability to compose original che…