A generative reference grammar of healthy TCR repertoires reveals cancer-associated immune remodeling
T-cell receptor (TCR) repertoires record how adaptive immunity is organized and how cancer and therapy reshape it, but this signal is hard to read: treatment-associated change is entangled with the V(D)J recombination constraints that shape every repertoire. We present CRAFT (Cancer Repertoire Anomaly Finding Transformer), a conditional sequence-to-sequence transformer that learns a nucleotide-level generative grammar of productive TCR-beta CDR3 sequences from healthy donors, conditioned on germline V(D)J assignments. A dual-head decoder mirrors the independence of V-D and D-J recombination, and curriculum training produces embeddings that define a healthy-reference coordinate system in which cancer-associated change appears as structured, measurable deviation. In proof-of-concept applications to a neoadjuvant checkpoint-blockade cohort sampled longitudinally across blood, and to serial single-cell profiling of T-cell subsets during oncolytic immunotherapy, CRAFT geometric metrics capture response-associated remodeling, including shifts in repertoire organization over time. On antigen-labeled benchmarks, CRAFT organizes specificity classes coherently, recovering structure that reflects shared antigen recognition.