DriveCode:
Domain Specific Numerical Encoding
for LLM-Based Autonomous Driving

Zhiye Wang2*, Yanbo Jiang1*, Rui Zhou2, Bo Zhang3,4, Fang Zhang5†,
Zhenhua Xu1†, Yaqin Zhang3, Jianqiang Wang1,5
1The School of Vehicle and Mobility, Tsinghua University,
2School of Information Science and Engineering, Lanzhou University,
3The Institute for AI Industry Research (AIR), Tsinghua University, 4DiDi, 5State Key Laboratory of Intelligent Green Vehicle and Mobility, Tsinghua University
* Equal contribution, † Corresponding author

Abstract

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.


Overview


Samples

We provide some data examples here.


Results

DriveCode consistently outperforms baselines across multiple datasets in both trajectory prediction and control signal generation tasks.

Trajectory Prediction on OmniDrive

Method L2 Error (m) ↓
Text 3.0797
DriveCode (Ours) 2.8274

Control Signals Prediction on DriveGPT4

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

Control Signals Prediction on DriveGPT4-V2

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

Supplementary Results

Robustness Experiments

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.

Normalization Strategies

Comparison of normalization strategies on control signal prediction across DriveGPT4 and DriveGPT4-V2 datasets. DriveGPT4 does not include point error evaluation (marked as —).

DatasetMethod Theta Error (deg) ↓ Point Error (L2, m) ↓ Speed Error (m/s) ↓
DriveGPT4Raw value (DriveCode)7.711.08
Per-type z-score8.901.14
Per-type min-max8.881.11
DriveGPT4-V2Raw value (DriveCode)0.073770.011370.02131
Per-type z-score0.072760.011310.02164
Per-type min-max0.070660.012610.02229

Unit Variation Robustness

Speed uses m/s, km/h, mph; angle uses degree and radian (DriveGPT4 dataset).

SettingSpeed RMSE ↓Angle RMSE ↓
Original DriveCode1.087.71
Mixed units1.348.89

Numerical Magnitude Robustness

Samples are grouped by the magnitude of ground-truth values using the 33.3%, 66.7%, and 95% quantiles (DriveGPT4 dataset).

TaskGT Value RangeDriveCodeVariantText-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

Sign Robustness

Samples are grouped into negative, near-zero, and positive intervals by the sign of ground-truth values (DriveGPT4 dataset).

TaskGT Value RangeDriveCodeVariantText-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

Ablation Studies

Variant vs. DriveCode on DriveGPT4

MethodTheta Error (deg) ↓Speed Error (m/s) ↓
Variant8.631.11
DriveCode (Ours)7.711.08

Encoding Variants on DriveGPT4-V2

MethodTheta Error (deg) ↓Point Error (L2, m) ↓Speed Error (m/s) ↓
Text0.079500.013630.02231
Variant0.070780.011400.02139
Variant20.088770.013910.02264
DriveCode (Ours)0.073770.011370.02131

Efficiency Analysis

Efficiency comparison between baseline models and DriveCode. Tested on DriveGPT4 dataset.

MethodLatency (s) ↓Avg Time / Sample (s) ↓
xVal6776.413.1979
Text7152.363.3769
Variant6763.793.1920
DriveCode (Ours)6737.913.1798

Lane Change Visualization

Examples of lane changing with DriveCode: successful lane change, no collision.

Lane change examples with DriveCode

Contact

For any questions, please send email to wzhiye2023 at lzu dot edu dot cn.

Citation

@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}, 
}