Phase III Capstone · Days 42–44 · ~8 hours Prerequisites: Exercises 05 (LoRA fine-tuning), Study notes 06–07
Fine-tune a small LLM (1–3B parameters) to be a knowledgeable robotics domain assistant using QLoRA. The model should answer questions about ROS 2, navigation, sensors, warehouse robot systems, and common failure modes significantly better than the base model.
┌──────────────────────────────────────────┐
│ Robotics LoRA Assistant │
│ │
│ ┌────────────────┐ ┌───────────────┐ │
│ │ Base Model │ │ LoRA Adapter │ │
│ │ (LLaMA 3.2 1B) │ +│ (rank 32) │ │
│ │ 4-bit quantized │ │ ~2.5M params │ │
│ └────────────────┘ └───────────────┘ │
│ │
│ Input: "What causes line sensor drift?" │
│ Output: Domain-accurate explanation │
└──────────────────────────────────────────┘
| Source | Content | Estimated QA Pairs |
|---|---|---|
knowledge/systems/ |
AMR subsystem docs | 100+ |
knowledge/errors.json |
Error codes + causes | 50+ |
knowledge/amr-system-overview.md |
System architecture | 30+ |
| ROS 2 documentation | Concepts, nodes, topics | 100+ |
docs/rca/ |
Past RCA reports | 50+ |
| Navigation algorithms | SLAM, path planning, localization | 50+ |
| Sensor fusion | IMU, odometry, line sensor | 30+ |
Target: 400–500 high-quality instruction-response pairs.
mkdir -p data/robotics-qa
{"instruction": "...", "output": "..."}meta-llama/Llama-3.2-1B (or TinyLlama-1.1B)q_proj, v_proj, k_proj, o_projCreate an evaluation set of 50+ robotics questions:
| Category | Example Question | Count |
|---|---|---|
| Error codes | “What does NAV_ESTIMATED_STATE_NOT_FINITE mean?” | 10 |
| Troubleshooting | “Robot stopped with MOTOR_OVERCURRENT, what to check?” | 10 |
| ROS 2 | “How do ROS 2 lifecycle nodes work?” | 10 |
| Navigation | “Explain the difference between DWA and TEB planners” | 10 |
| System architecture | “What components make up the AMR navigation stack?” | 10 |
Metrics: - Qualitative: side-by-side comparison (base vs LoRA vs GPT-4) - Quantitative: perplexity on held-out robotics text - Domain accuracy: manual scoring of answer correctness (1–5 scale)
| Deliverable | Description |
|---|---|
data/robotics-qa/train.json |
Training dataset (400+ QA pairs) |
data/robotics-qa/eval.json |
Evaluation dataset (50+ questions) |
adapters/robotics-lora/ |
Trained LoRA adapter weights |
eval_results.md |
Evaluation results with comparisons |
examples/ |
10 example conversations showing improvement |
README.md |
This file (updated with results) |
## Results
### Training
- Base model: ___
- LoRA rank: ___
- Training examples: ___
- Epochs: ___
- Final training loss: ___
- Training time: ___
### Quality Comparison (1-5 scale, 5=best)
| Question Category | Base Model | LoRA Model | GPT-4 |
|-------------------|-----------|-----------|-------|
| Error codes | | | |
| Troubleshooting | | | |
| ROS 2 concepts | | | |
| Navigation | | | |
| System arch | | | |
| **Average** | | | |
### Inference Benchmarks
| Metric | FP16 | INT8 | INT4 (GGUF) |
|---------------|---------|---------|-------------|
| Memory (GB) | | | |
| Tokens/sec | | | |
| Latency (s) | | | |
This project is the Phase III capstone of the LLM-to-VLA curriculum. Next: Phase IV — Multimodal Models (CLIP, LLaVA, Flamingo)