· 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.

Prompt path
Instruction
what to do
Context
evidence or examples
Constraints
format and rules
Decoding
generate output
Evaluation
check usefulness and failures

2. Prompt types

TypeUse
zero-shotdirect instruction
few-shotexamples in context
chain-of-thought styleelicit reasoning traces when appropriate
structured outputJSON, tables, labels
retrieval-augmented promptground 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:

  1. define the concept in one sentence;
  2. explain the data flow;
  3. name the main failure mode;
  4. connect it to evaluation, multilinguality, or fine-tuning.

References

Share:
Back to Blog

Related Posts

View All Posts »
FoundationsNLP and LLMsEN

Attention Mechanism

Attention as a learned way to decide what context matters for each token.

FoundationsNLP and LLMsEN

Fine-Tuning Transformers

How pretrained language models are adapted to a task or domain with supervised data.

FoundationsNLP and LLMsEN

LLM Evaluation and Failure Modes

A practical map of LLM evaluation risks: hallucination, prompt sensitivity, bias, contamination, and brittle benchmarks.

FoundationsNLP and LLMsEN

NLP Evaluation

Why NLP evaluation needs metrics, uncertainty, human judgment, and task-specific error analysis.