Files

41 lines
3.5 KiB
TeX

\section{Introduction}
The rapid advancement of large language models (LLMs) has transformed natural language processing, yet their development remains concentrated among organizations with substantial computational resources. Fine-tuning a 7B parameter model traditionally requires 8+ high-end GPUs and costs thousands of dollars~\citep{touvron2023llama}, placing state-of-the-art capabilities beyond reach for individual researchers, educators, and developers in resource-constrained environments. This accessibility gap threatens to create a two-tier AI ecosystem where innovation is gatekept by infrastructure costs rather than ideas.
\textbf{Gym} addresses this challenge through comprehensive open-source infrastructure that reduces both monetary and technical barriers to AI model training. Our platform supports 100+ model architectures spanning text, vision, audio, and multimodal domains, implements 15+ training algorithms from supervised fine-tuning to advanced reinforcement learning, and provides quantization techniques that enable training 70B+ parameter models on consumer-grade GPUs with 16GB VRAM.
\subsection{Key Contributions}
This paper presents the following contributions:
\begin{enumerate}
\item \textbf{Unified Training Infrastructure}: A modular architecture supporting full fine-tuning, LoRA~\citep{hu2021lora}, QLoRA~\citep{dettmers2023qlora}, DoRA~\citep{liu2024dora}, PiSSA~\citep{meng2024pissa}, and novel methods like Group Relative Policy Optimization (GRPO)~\citep{shao2024deepseekmath}.
\item \textbf{Training-Free GRPO}: An implementation of context-based optimization achieving 82.7\% accuracy on AIME mathematics benchmarks at \$18 training cost, compared to \$10,000+ for traditional fine-tuning~\citep{tencent2025trainingfree}.
\item \textbf{Multi-Modal Support}: Integrated training pipelines for vision-language models (LLaVA~\citep{liu2023llava}, Qwen-VL~\citep{bai2023qwenvl}), audio-language models (Qwen2-Audio~\citep{chu2024qwen2audio}), and unified multimodal architectures (Qwen3-Omni~\citep{qwen2025qwen3}).
\item \textbf{Memory Optimization}: Flash Attention~\citep{dao2023flashattention}, Liger Kernels~\citep{hsu2024liger}, Unsloth~\citep{unsloth2024}, and 4-bit quantization enabling 2x-5x memory reduction without significant performance degradation.
\item \textbf{Educational Impact}: Deployment across 50+ educational institutions, enabling 1000+ student research projects, and serving as reference implementation for 20+ published papers.
\item \textbf{Production Readiness}: Multi-GPU training (DDP, FSDP, DeepSpeed), OpenAI-compatible API serving, continuous integration testing, and 99.5\% uptime in production deployments.
\end{enumerate}
\subsection{Evolution Timeline}
Gym's 2.5-year development reflects the rapid evolution of LLM training methods:
\begin{itemize}
\item \textbf{May 2023 (v2023.05)}: Initial fork from LLaMA Factory, supporting LLaMA 1/2 with basic LoRA.
\item \textbf{August 2023}: QLoRA integration enabling 65B models on 24GB GPUs.
\item \textbf{December 2023}: Multi-GPU support (DDP, FSDP), Flash Attention integration.
\item \textbf{March 2024}: DPO~\citep{rafailov2023dpo}, KTO~\citep{ethayarajh2024kto}, ORPO~\citep{hong2024orpo} for preference optimization.
\item \textbf{June 2024}: Multi-modal training (LLaVA, Qwen-VL).
\item \textbf{September 2024}: Qwen3 support including 72B models.
\item \textbf{January 2025}: Unsloth and Liger kernel integration (2x speedup).
\item \textbf{September 2025 (v2025.09)}: GRPO/GSPO integration, Training-Free GRPO, official rebrand from LLaMA Factory to Gym.
\end{itemize}