How internlm/caprl works
Project type and purpose
• This is an ML research codebase for training, evaluating, and serving an image-captioning model called CapRL.
• Components include:
• QA data curation pipeline (generate, extract, answer, filter QA)
• Pretraining/training recipe (initializing Qwen2.5-VL, running RL training via LLaMAFactory)
• Evaluation framework (Prism_Evaluation) to assess caption quality by downstream VQA
• Inference/serving scripts (vLLM-based OpenAI-compatible API)
File structure
• Top-level:
• QA_data_curation/ – four sequential subfolders (1_generate_qa, 2_extract_qa, 3_answer_qa, 4_filter_qa)
• Prism_Evaluation/ – evaluation scripts (Eval_CapRL.py, reward-model wrappers)
• eval_results/ – JSON results of Prism runs
• assets/ – images used in README and performance figures
• setup.sh, pyproject.toml – environment setup and dependencies
• Shell scripts (bash.sh, rjob.sh) launch jobs on clusters or vLLM service
• No traditional “frontend/backend” split; instead a data-science pipeline and service component
Key insights from README
• QA curation consists of four distinct stages for building a filtered 75K QA dataset
• Pretraining uses Qwen2.5-VL-3B as an initial policy, with LLaMAFactory for RL
• Inference is served via vLLM, exposing an OpenAI-compatible API
• Evaluation uses the Prism framework: generate caption → ask VQA model → compute reward
Detail
• Shell scripts as triggers at each stage
• Parameters (e.g., ROTATE_NUM, reward-model-path)
• RL training recipe and HuggingFace components