Large language models (LLMs) have shown great promise for autonomous driving, yet their discrete tokenization of numbers not only limits precise numerical reasoning but also introduces redundant decoding steps for each value, posing challenges for vehicle control. These limitations affect both the processing of sensor measurements and the generation of precise control commands, creating a fundamental barrier for deploying LLM-based autonomous driving systems. In this paper, we introduce DriveCode, a novel numerical encoding method that represents continuous values as dedicated embeddings rather than discrete text tokens. DriveCode employs a number projector to map scalars into the language model's hidden space, enabling seamless integration with visual and textual features in a unified multimodal sequence. Evaluated on OmniDrive, DriveGPT4, and DriveGPT4-V2 datasets, DriveCode demonstrates superior performance in trajectory prediction and control signal generation, confirming its effectiveness for LLM-based autonomous driving systems.
We provide some data examples here.
DriveCode consistently outperforms baselines across multiple datasets in both trajectory prediction and control signal generation tasks.
| Method | L2 Error (m) ↓ |
|---|---|
| Text | 3.0797 |
| DriveCode (Ours) | 2.8274 |
| Method | Speed (m/s) | Turning Angle (degree) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| RMSE ↓ | A0.1 ↑ | A0.5 ↑ | A1.0 ↑ | A5.0 ↑ | RMSE ↓ | A0.1 ↑ | A0.5 ↑ | A1.0 ↑ | A5.0 ↑ | |
| ADAPT | 3.02 | 9.56 | 24.77 | 37.07 | 90.39 | 11.98 | 27.93 | 66.83 | 75.13 | 89.45 |
| DriveGPT4 | 1.30 | 30.09 | 60.88 | 79.92 | 98.44 | 8.98 | 59.23 | 72.89 | 79.59 | 95.32 |
| xVal | 1.13 | 26.58 | 63.46 | 82.53 | 99.10 | 8.78 | 56.99 | 72.89 | 80.08 | 93.20 |
| DriveCode (Ours) | 1.08 | 27.50 | 64.60 | 82.99 | 99.10 | 7.71 | 57.18 | 72.54 | 80.25 | 93.71 |
| Method | Theta Error (degree) ↓ | Point Error (L2, m) ↓ | Speed Error (m/s) ↓ |
|---|---|---|---|
| xVal | 0.07409 | 0.01166 | 0.02162 |
| DriveCode (Ours) | 0.07377 | 0.01137 | 0.02131 |
We conduct robustness experiments on normalization strategies, unit variation, numerical magnitude, and sign changes. Decimal variants such as "3", "3.0", "3.00", and "3e0" are parsed into the same floating-point value before numerical encoding.
Comparison of normalization strategies on control signal prediction across DriveGPT4 and DriveGPT4-V2 datasets. DriveGPT4 does not include point error evaluation (marked as —).
| Dataset | Method | Theta Error (deg) ↓ | Point Error (L2, m) ↓ | Speed Error (m/s) ↓ |
|---|---|---|---|---|
| DriveGPT4 | Raw value (DriveCode) | 7.71 | — | 1.08 |
| Per-type z-score | 8.90 | — | 1.14 | |
| Per-type min-max | 8.88 | — | 1.11 | |
| DriveGPT4-V2 | Raw value (DriveCode) | 0.07377 | 0.01137 | 0.02131 |
| Per-type z-score | 0.07276 | 0.01131 | 0.02164 | |
| Per-type min-max | 0.07066 | 0.01261 | 0.02229 |
Speed uses m/s, km/h, mph; angle uses degree and radian (DriveGPT4 dataset).
| Setting | Speed RMSE ↓ | Angle RMSE ↓ |
|---|---|---|
| Original DriveCode | 1.08 | 7.71 |
| Mixed units | 1.34 | 8.89 |
Samples are grouped by the magnitude of ground-truth values using the 33.3%, 66.7%, and 95% quantiles (DriveGPT4 dataset).
| Task | GT Value Range | DriveCode | Variant | Text-only |
|---|---|---|---|---|
| Turning Angle | [0, 0.26) | 1.1416 95% CI: 0.7626–1.4807; N=1404 | 1.4035 95% CI: 0.9880–1.7955; N=1403 | 1.5338 95% CI: 1.1637–1.8924; N=1401 |
| [0.26, 6.98) | 2.1996 95% CI: 1.9950–2.4145; N=608 | 2.7438 95% CI: 2.1821–3.3726; N=608 | 2.7683 95% CI: 2.4180–3.1255; N=607 | |
| [6.98, ∞) | 34.1333 95% CI: 23.0185–44.7093; N=104 | 37.6696 95% CI: 25.9657–48.5228; N=106 | 38.7174 95% CI: 26.9667–50.4053; N=107 | |
| Speed | [0, 1.44) | 0.6544 95% CI: 0.4411–0.8653; N=705 | 0.7037 95% CI: 0.4835–0.9238; N=705 | 0.8359 95% CI: 0.5740–1.0823; N=705 |
| [1.44, 7.54) | 1.1763 95% CI: 1.0438–1.3050; N=705 | 1.2319 95% CI: 1.0848–1.3835; N=706 | 1.3251 95% CI: 1.1534–1.4963; N=706 | |
| [7.54, 15.70) | 1.3535 95% CI: 1.1455–1.5731; N=600 | 1.3422 95% CI: 1.1592–1.5386; N=600 | 1.4156 95% CI: 1.2430–1.6002; N=598 | |
| [15.70, ∞) | 1.0292 95% CI: 0.7689–1.3121; N=106 | 1.1536 95% CI: 0.8704–1.4487; N=106 | 1.3385 95% CI: 0.9583–1.6979; N=106 |
Samples are grouped into negative, near-zero, and positive intervals by the sign of ground-truth values (DriveGPT4 dataset).
| Task | GT Value Range | DriveCode | Variant | Text-only |
|---|---|---|---|---|
| Theta | (-∞, -0.05) | 9.3818 95% CI: 6.4341–12.2534; N=421 | 9.2308 95% CI: 6.2741–12.1288; N=421 | 9.8490 95% CI: 6.6775–12.6932; N=422 |
| [-0.05, 0.05] | 1.1889 95% CI: 0.7754–1.5594; N=1251 | 1.4857 95% CI: 1.0493–1.9053; N=1250 | 1.6188 95% CI: 1.2121–1.9940; N=1249 | |
| (0.05, ∞) | 14.0074 95% CI: 7.0870–19.6879; N=444 | 16.3430 95% CI: 9.2816–22.5797; N=446 | 16.7208 95% CI: 9.4964–22.9874; N=444 | |
| Speed | (-∞, -0.05) | 3.5897 95% CI: 1.6277–5.1443; N=13 | 3.6364 95% CI: 1.5787–5.2521; N=13 | 3.6722 95% CI: 1.4158–5.3855; N=13 |
| [-0.05, 0.05] | 0.1735 95% CI: 0.1107–0.2385; N=366 | 0.2152 95% CI: 0.1223–0.3109; N=366 | 0.3085 95% CI: 0.1404–0.4671; N=366 | |
| (0.05, ∞) | 1.1533 95% CI: 1.0518–1.2607; N=1737 | 1.1882 95% CI: 1.0862–1.2877; N=1738 | 1.2948 95% CI: 1.1820–1.4103; N=1736 |
| Method | Theta Error (deg) ↓ | Speed Error (m/s) ↓ |
|---|---|---|
| Variant | 8.63 | 1.11 |
| DriveCode (Ours) | 7.71 | 1.08 |
| Method | Theta Error (deg) ↓ | Point Error (L2, m) ↓ | Speed Error (m/s) ↓ |
|---|---|---|---|
| Text | 0.07950 | 0.01363 | 0.02231 |
| Variant | 0.07078 | 0.01140 | 0.02139 |
| Variant2 | 0.08877 | 0.01391 | 0.02264 |
| DriveCode (Ours) | 0.07377 | 0.01137 | 0.02131 |
Efficiency comparison between baseline models and DriveCode. Tested on DriveGPT4 dataset.
| Method | Latency (s) ↓ | Avg Time / Sample (s) ↓ |
|---|---|---|
| xVal | 6776.41 | 3.1979 |
| Text | 7152.36 | 3.3769 |
| Variant | 6763.79 | 3.1920 |
| DriveCode (Ours) | 6737.91 | 3.1798 |
Examples of lane changing with DriveCode: successful lane change, no collision.
@misc{wang2026drivecodedomainspecificnumerical,
title={DriveCode: Domain Specific Numerical Encoding for LLM-Based Autonomous Driving},
author={Zhiye Wang and Yanbo Jiang and Rui Zhou and Bo Zhang and Fang Zhang and Zhenhua Xu and Yaqin Zhang and Jianqiang Wang},
year={2026},
eprint={2603.00919},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2603.00919},
}