anlp-a3-transformer

transformer decoder-only sequence model trained for ANLP Monsoon 2026 Assignment 3 (Part A), implemented from scratch in PyTorch (no mamba-ssm / fla).

architecture transformer
parameters 4,038,912
d_model / layers 256 / 5
max sequence length 256
analytic FLOPs / 256-token sequence 2,402,025,472
best validation token accuracy 0.8160
learning rate 0.001
cipher conditioning real

Trained as a prefix LM on [BOS] ciphertext [SEP] plaintext [EOS] with the loss on the plaintext span only.

Trained on the revised dataset (data_new, released 2026-11-11), pairs with len(cipher) + len(plain) <= 253, 200k pairs for 2 epochs.

Note on the task. Deleting the 18 punctuation null symbols aligns ciphertext to plaintext 1:1, and the cipher is a deterministic stream cipher keyed by the plaintext prefix. These ~4M-parameter models decode the first characters of a sequence almost perfectly, but on the test set they recover exactly only plaintexts that also occur in the training set; none decrypts an unseen plaintext in full. See the report for the analysis.

Use

from huggingface_hub import snapshot_download
from part1.hf_utils import load_checkpoint
model, tok, meta = load_checkpoint(snapshot_download("vipenl26/anlp-a3-transformer"), device="cuda")
Downloads last month
64
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support