Published December 26, 2025 | Version v1

BashGemma: Fine-tuning a 270M Parameter Model for Natural Language to Bash Translation

Authors/Creators

Description

We present BashGemma, a fine-tuned version of Google’s FunctionGemma 270M model for translating natural language queries into structured bash command tool calls. Using LoRA fine-tuning on 9,153 NL2Bash examples with a novel response-only training approach, we achieve 57.4% NLC2CMD accuracy on a held-out test set—a 52.9 percentage point improvement over the base model. Our approach demonstrates that extremely small language models (270M parameters, 540MB) can perform useful bash command generation when properly fine-tuned on structured output formats. We release our model, training code, and evaluation suite to support future research in edge-deployable code generation.

Files

bashgemma.pdf

Files (646.9 kB)

Name Size Download all
md5:e49c1d2823abb3157fc981a7a49ddf8e
646.9 kB Preview Download

Additional details

Software