what's the prompt used for code completion?
- User
what's the prompt used for code completion?
Assistant
Copilot Arena uses several different prompt templates for code completion, depending on the chosen model and whether overlap is desired. They are all located in the
server/templatesdirectory. Here's a breakdown:-
chat_psm.yaml: This prompt uses a chat-style message format. It provides an example of how the prefix and suffix should be used to generate the completion, and explicitly instructs the model to only output code within<CODE>tags. It emphasizes respecting spacing, new lines, and indentation. This prompt does not use overlap. -
chat_psm_overlap.yaml: This prompt is similar tochat_psm.yaml, but specifically designed for overlapping completions. It instructs the model to begin the completion with the last line of the prefix and end with the first line of the suffix. It includes two examples demonstrating how overlap should work, and stresses the importance of correct indentation. -
chat_spm_overlap.yaml: This prompt is nearly identical tochat_psm_overlap.yamlbut with the order of prefix and suffix reversed in the prompt. This is likely for models which function better with this ordering for overlap. It also emphasizes the use of XML notation. -
deepseek.yaml: This prompt uses Deepseek's specific tokens (<|fim_begin|>,<|fim_hole|>,<|fim_end|>,<|eos_token|>) for completion. It provides an example and instructs the model to avoid code block delimiters and respect formatting. This prompt uses prefix and suffix, implying a non-overlapping completion. -
deepseek_fim.yaml: This prompt is a simpler Deepseek prompt using only the prefix and designed for fill-in-the-middle (FIM) style completion.
Each of these files defines the
prompt,stop_tokens, andargsrequired by thePromptGeneratorclass inprompt_generator.py. Thepromptfield contains the instructions and example,stop_tokenslists the sequences that signal the end of the completion, andargsspecifies the variables (likeprefix,suffix) that will be inserted into the prompt.-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.