🏎️ DriveTwinLLM: Dual-Persona Automotive Diagnostic AI

DriveTwinLLM is an instruction-tuned, physics-grounded automotive diagnostic language model built on top of Qwen/Qwen2.5-3B-Instruct. It was fine-tuned using LoRA on NVIDIA B200 GPU hardware (180 GB VRAM) to achieve 98.13% evaluation token accuracy on real-world vehicle trouble codes, live ECU telemetry, and OEM service manuals.

The model enforces strict zero-hallucination guardrails and features a specialized Dual-Persona Architecture:


🌟 Dual-Persona Capabilities

1. πŸš— Driver Care Persona (ELI5 + Billing)

  • Child-Friendly Physical Analogies: Translates mechanical issues into simple, intuitive concepts (e.g., comparing a 6-cylinder engine to 6 rowers in a boat where one stopped pulling).
  • Approximate Repair Billing Breakdown: Generates 4-row estimated invoice tables containing:
    • Diagnostic computer scan fee ($90 – $130)
    • Replacement OEM part costs
    • Certified shop labor ($120/hr flat-rate standard)
    • Total estimated invoice range before taxes
  • Shop Negotiation Questions: Generates 3 specific questions for drivers to ask technicians to prevent overcharging.
  • Safe Driving Limits: Explicit recommendations on whether the car is drivable and maximum emergency limp-mode range.

2. πŸ”§ Master Mechanic Persona (OEM & Pinouts)

  • Multimeter & Electrical Specs: Exact primary coil resistance ($0.8,\Omega - 1.2,\Omega$), piezo injector stack ($180,k\Omega - 220,k\Omega$, isolation $> 10,M\Omega$), 5.0V reference pinouts ($5.0\text{V} \pm 0.1\text{V}$), and loaded ground drop thresholds ($< 0.15\text{V}$).
  • Oscilloscope Waveforms: Drive pulse voltages ($140 - 160\text{V}$) and peak-and-hold current ramps ($8\text{A}$) without clipped plateaus.
  • Fastener Torque Specifications: Complete torque tables in both Metric ($Nm$) and Imperial ($ft\text{-}lbs$).
  • Component Swap Defect Isolation: Systematic component swap logic with diagnostic trouble code migration rules.

3. πŸ›‘οΈ Zero-Hallucination Telemetry Grounding

  • Strictly refuses unmonitored sensors (transmission fluid temperature, TPMS, cabin humidity) and invalid codes (P9999), redirecting the user to monitored engine channels (Coolant Temp: 86.1Β°C, Oil Temp: 90.3Β°C, IAT: 28.3Β°C).

πŸ“Š Training Specifications & Evaluation

  • Base Architecture: Qwen/Qwen2.5-3B-Instruct
  • Fine-Tuning Method: LoRA (Low-Rank Adaptation) via PEFT & TRL
    • LoRA Rank ($r$): 16
    • LoRA Alpha ($\alpha$): 32
    • Target Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
  • Compute Hardware: NVIDIA B200 GPU (180 GB VRAM)
  • Dataset Size: 2,288 curated dual-persona instruction pairs (5.82 MB) + 287 MB ECU telemetry corpus
  • Training Epochs: 3 (408 steps)
  • Final Training Step Loss: 0.0432
  • Validation Loss: 0.0705
  • Evaluation Token Accuracy: 98.13%

πŸš€ Quickstart Usage with PEFT

import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

base_model_id = "Qwen/Qwen2.5-3B-Instruct"
lora_model_id = "Kungumapriyaa/DriveTwinLLM"

tokenizer = AutoTokenizer.from_pretrained(lora_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
    base_model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)
model = PeftModel.from_pretrained(base_model, lora_model_id)

messages = [
    {
        "role": "system",
        "content": "You are Drive-Twin Driver Care AI. Explain simply like to a child, provide safe driving limits, and approximate billing breakdown."
    },
    {
        "role": "user",
        "content": "My check engine light is on for Cylinder 3 misfire (P0303). How much will this cost to fix?"
    }
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.3)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

πŸ“œ Citation & License

Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Kungumapriyaa/DriveTwinLLM

Base model

Qwen/Qwen2.5-3B
Adapter
(1342)
this model