When Machines Speak: A Unified Generative Framework for Integrating Machine-Native Symbols into Pretrained Large Language Models
Organizations: Google Inc.
Abstract
Many real-world AI systems represent entities, behaviors, and structured information using discrete machine-native symbols rather than natural language. While these representations are compact and preserve task-relevant structure, they lie outside the linguistic token space of pretrained large language models (LLMs), creating a fundamental divide between language modeling and structured prediction. We introduce UniLang, a unified generative framework that bridges this divide by extending pretrained LLMs to treat machine-native symbols as first-class generative units alongside natural-language tokens. UniLang expands the LLM's vocabulary and embedding space with grounded machine-native representations, enabling textual and symbolic tokens to be jointly modeled and generated under a single autoregressive objective. This unified interface allows pretrained LLMs to directly operate on machine-native representations without requiring them to be verbalized as natural language or relying on task-specific architectures. We evaluate UniLang on two structurally distinct tasks, sequential recommendation and legal precedent prediction, spanning different domains and types of structured prediction. Across both tasks, UniLang consistently outperforms strong baselines, demonstrating a path toward extending pretrained LLMs beyond language and using them as a common generative modeling backbone for heterogeneous machine-native representations.
Figures & tables
| Dataset | Metric | Discriminative | Generative | Improvement | ||||
| SASRec | BERT4Rec | S 3 -Rec | P5 | TIGER (re-impl.) | UniLang (ours) | |||
| Beauty | Recall@5 | 0.0387 | 0.0203 | 0.0387 | 0.0163 | 0.0361 | 0.0419 | 8.27% |
| NDCG@5 | 0.0249 | 0.0124 | 0.0244 | 0.0107 | 0.0241 | 0.0299 | 20.08% | |
| Recall@10 | 0.0605 | 0.0347 | 0.0647 | 0.0254 | 0.0595 | 0.0603 | -6.80% | |
| NDCG@10 | 0.0318 | 0.0170 | 0.0327 | 0.0136 | 0.0318 | 0.0358 | 9.48% | |
| ML-1m | Recall@5 | 0.1273 | 0.1011 | 0.1258 | 0.1098 | 0.0634 | 0.1661 | 30.48% |
| metric | mean standard error |
| Recall@5 | 0.1908 0.00016 |
| NDCG@5 | 0.1378 0.00017 |
| Recall@10 | 0.2596 0.00014 |
| NDCG@10 | 0.1600 0.00014 |
| Dataset | Metric | Retrieval | Classification | Generative | Improvement | ||
| BM25 | fine-tuned SBERT | LEGAL-BERT | DistilBERT | UniLang (ours) | |||
| 10K | Recall@1 | 0.0501 | 0.0899 | 0.1666 | 0.1967 | 0.2938 | 49.36% |
| Recall@10 | 0.1952 | 0.4479 | 0.4765 | 0.5912 | 0.6823 | 15.41% | |
| NDCG@10 | 0.1137 | 0.2627 | 0.3075 | 0.3773 | 0.4775 | 26.56% | |
| 20K | Recall@1 | 0.0413 | 0.0753 | 0.1280 | 0.1674 | 0.2486 | 48.51% |
| Recall@10 | 0.1667 | 0.3850 | 0.3684 | 0.5216 | 0.6290 | 20.59% | |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | #users | #items | #actions | Avg. length | Density |
| Beauty | 40,226 | 54,542 | 0.35m | 8.8 | 0.02% |
| ML-1m | 6,040 | 3,416 | 1m | 163.5 | 4.79% |
| ML-20m | 138,493 | 26,744 | 20m | 144.4 | 0.54% |
| Dataset (# cited passages) | # Citing Passage Surface Forms | # Cited Passage Surface Forms |
| 10k | 1,294,730 | 798,558 |
| 20k | 1,586,663 | 1,140,058 |
| 50k | 2,079,704 | 1,821,751 |
| Feature | Mean | Std | Min | Max |
| Length of cited text (chars) | 306 | 225 | 24 | 18,342 |
| Length of citing context (chars) | 562 | 216 | 5 | 14,062 |
| Dataset | Validation size | Sample size |
| Beauty | 40,226 | 5,000 |
| MovieLens-1m | 6,040 | 1,000 |
| MovieLens-20m | 138,493 | 1,000 |
| 10k | 103,812 | 1,000 |
| 20k | 134,737 | 1,000 |
| 50k | 190,051 | 1,000 |
| Hyperparameter | Beauty | ML-1M ML-20M | LePaRD 10k / 20k / 50k |
| Total training steps | 30k | 20k | 20k |
| Warm up | 3k | 2k | 3k |
| Peak learning rate | 1e-3 | 1e-3 | 1e-3 |
| End learning rate | 1e-5 | 5e-5 | 1e-5 |
| Ema decay | 0.99 | 0.99 | 0.99 |
| Commitment cost | 1.5 | 1.5 | 0.1 |
| Dataset | Beauty | ML-1M ML-20M | LePaRD 10k / 20k / 50k |
| Batch size | 1024 | 512 | 128 |
| Learning rate | |||
| Total steps | 4k | 4k | 8k |
| Dataset | Beauty | ML-1M ML-20M | LePaRD 10k / 20k / 50k |
| Batch size | 8 | 32/128 | 512 |
| Learning rate | |||
| LoRA dropout | 0.25 | 0.05 | 0.25 |
| Total training steps | 30k | 20k | 30k |
| Warm up | 2k | 2k | 2k |
Language Modeling
Language modeling develops systems that learn patterns in text and other sequences to understand, predict, and generate language.
See all 519 papers