CodeT5+ is a family of open code large language models released by the Salesforce research team, designed to support a wide range of code understanding and generation tasks. The model parameter sizes range from 220M to 16B, adopting an encoder-decoder architecture that can flexibly switch between encoder-only, decoder-only, or encoder-decoder modes.
Main capabilities:
- Code generation: Supports text-to-code generation, with strong performance on the HumanEval benchmark in zero-shot settings.
- Code understanding: Includes tasks such as code summarization and code retrieval.
- Multi-task pretraining: Learns rich representations from unimodal code data and bimodal code-text data through tasks such as span denoising, causal language modeling, contrastive learning, and text-code matching.
- Efficient scaling: Proposes a compute-efficient pretraining method that initializes models using frozen off-the-shelf LLMs (such as CodeGen).
- Instruction tuning: Follows the Code Alpaca method for instruction tuning, releasing InstructCodeT5+ 16B (for research non-commercial use only).
Usage:
- All models and tokenizers can be loaded via Hugging Face's AutoModelForSeq2SeqLM and AutoTokenizer.
- For the 2B, 6B, 16B, and InstructCodeT5+ 16B models, trust_remote_code=True must be set when loading, and it is recommended to pass additional prompts to the decoder via decoder_input_ids to improve generation quality.
- A fine-tuning script tune_codet5p_seq2seq.py is provided, supporting fine-tuning on custom data, with --load to select the model, adjustment of hyperparameters such as --epochs and --lr, support for single-GPU and multi-GPU training, mixed precision via --fp16, and DeepSpeed optimization via --deepspeed.
- Reproduction scripts for HumanEval evaluation and text-to-code retrieval are provided.
Applicable scenarios:
- Academic research and experiments related to code intelligence.
- Fine-tuning and evaluation for downstream tasks such as code generation, code summarization, and code retrieval.
- Scenarios requiring an open-source code large model for secondary development.
Limitations:
- The InstructCodeT5+ 16B checkpoint is for research and non-commercial use only.
- Some models (2B, 6B, 16B) require setting trust_remote_code=True to load.
- Reproduction results may differ slightly due to sampling randomness.
- No specific pricing, cost, or commercial licensing information is provided.