How rks-2804/bwr_model works
Project type and purpose
• This is an open-source research toolkit and CLI pipeline for performing collaborative model merging via the Best-Worst-Random (BWR) algorithm.
• It orchestrates:
• Population-based search over LoRA/adapters or full-parameter LLM experts
• Multiple merge strategies (weighted average, task arithmetic, TIES, DARE)
• Evaluation on a library of JSON datasets (data/eval)
• Logging/monitoring via WandB and text logs
File structure
• Top level:
• search.py – main driver for BWR search
• evaluate.py – evaluation engine (validation/test loops)
• merge.py – implementations of merge methods
• overall_metrics.py – post-search metrics aggregation
• data/ – evaluation datasets (JSON)
• initial_experts/ – starter LoRA adapters or model shards
• search/*.sh – domain-specific bash wrappers that call search.py
• requirements.txt, bwr.yml – environment specs
• Patterns:
• Script-based pipeline: CLI → Python driver → modular functions
• Separation of concerns: search logic (search.py), merge logic (merge.py), evaluation logic (evaluate.py), I/O and logging
README for additional insights
• Detailed CLI usage patterns (search_nlgraph.sh, others)
• BWR algorithm description (population init, best/worst update, random reset)
• Merge methods and their parameters
• Instructions to add new data, new models, and new eval types
• External dependencies: HuggingFace (Gemma), WandB, Perspective API, Vertex AI