· Xiaojing Yang · NLP and LLMs · 2 min read
中文Prompting and Instruction Following
Prompting as task specification, interface design, and evaluation risk.
Core idea
A prompt is not just input text; it is a temporary task interface for a language model.
1. What prompting does
Prompting specifies the task, context, constraints, style, and output format without changing model weights. Instruction following depends on pretraining, instruction tuning, alignment, and decoding.
what to do
evidence or examples
format and rules
generate output
check usefulness and failures
2. Prompt types
| Type | Use |
|---|---|
| zero-shot | direct instruction |
| few-shot | examples in context |
| chain-of-thought style | elicit reasoning traces when appropriate |
| structured output | JSON, tables, labels |
| retrieval-augmented prompt | ground answer in external evidence |
3. Hugging Face practice
from transformers import pipeline
generator = pipeline("text-generation", model="Qwen/Qwen2.5-0.5B-Instruct")
out = generator("Explain cross-validation in one paragraph.", max_new_tokens=80)4. My research connection
Prompting matters for LLM evaluation because small wording changes can change performance. For multilingual tasks, prompts in English may not transfer equally across languages or domains.
Useful habit
Treat prompts as experimental variables.
Evaluation risk
Do not tune prompts on the final test set.
Takeaway
Prompting is powerful because it is lightweight, but that also makes it easy to overfit silently.
Interview pattern
My interview answer would usually be:
- define the concept in one sentence;
- explain the data flow;
- name the main failure mode;
- connect it to evaluation, multilinguality, or fine-tuning.
References
- Hugging Face Course
- Hugging Face Transformers documentation
- Hugging Face tokenizer summary
- Hugging Face fine-tuning guide
- Hugging Face PEFT
- The Illustrated Transformer
- Speech and Language Processing, Jurafsky & Martin
- Stanford CS224N readings
- Attention Is All You Need
- COMET: A Neural Framework for MT Evaluation