Skip to content

Tool use distillation experiments - #84

Open
aryaprabhudesai wants to merge 2 commits into
mainfrom
distill-tool-usage
Open

Tool use distillation experiments#84
aryaprabhudesai wants to merge 2 commits into
mainfrom
distill-tool-usage

Conversation

@aryaprabhudesai

Copy link
Copy Markdown
Contributor

Description

Adds a full distillation pipeline to improve Qwen3.5-9B's tool-use competency in CooperBench's multi-agent team setting. The pipeline downloads the CooperBench/team-coop dataset, converts teacher trajectories to the training format, runs SFT on Modal, uploads the adapter to HuggingFace, and serves the model via vLLM for evaluation.

Changes

  • Dataset download & analysis (scripts/distill/download_team_coop.py, extract_successful.py, analyze_coverage.py): downloads CooperBench/team-coop from HuggingFace, filters to successful+verified trajectories, and reports scenario coverage across the 8 canonical team-harness tool patterns
  • Format conversion (scripts/distill/convert_codex_to_miniswe.py): converts 1,153 Codex codex_stream_log teacher trajectories (gpt-5.5-hao) to mini_swe_agent_v2 format so training data matches inference format — handles [command] parsing, timing-line stripping, diff block removal, and exit-code extraction
  • SFT training (scripts/distill/train_modal.py): QLoRA (4-bit NF4, r=64/α=128) on Qwen3.5-9B over 1,230 trajectories on a Modal A100-80GB; uses action masking, gradient checkpointing, and a volume-commit callback to persist checkpoints; downloads weights locally after training
  • Adapter upload (scripts/distill/upload_adapter.py): uploads the LoRA adapter to CooperBench/qwen3.5-9b-tool-use-sft on HuggingFace
  • vLLM serving (scripts/distill/serve_vllm_modal.py): serves base model + LoRA adapter on Modal via vllm==0.19.0 with qwen3_coder tool-call parser; eval agent config in agent_config_qwen35_sft.yaml

Checklist

  • Code follows project style
  • Tests pass locally
  • Documentation updated (if needed)

@aryaprabhudesai aryaprabhudesai self-assigned this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant