рдореБрдЦреНрдп рдордЬрдХреБрд░рд╛рдХрдбреЗ рдЬрд╛
JobCannon
рд╕рд░реНрд╡ рдХреМрд╢рд▓реНрдпреЗ

Prompt Engineering (Advanced)

Master LLMs: chain-of-thought, few-shot, prompt optimization, RAG

тмв рд╢реНрд░реЗрдгреА 3рддрд╛рдВрддреНрд░рд┐рдХ
+$20k-
рдкрдЧрд╛рд░рд╛рд╡рд░реАрд▓ рдкрд░рд┐рдгрд╛рдо
5 рдорд╣рд┐рдиреЗ
рд╢рд┐рдХрдгреНрдпрд╛рд╕ рд▓рд╛рдЧрдгрд╛рд░рд╛ рд╡реЗрд│
рдордзреНрдпрдо
рдХрд╛рдард┐рдгреНрдп
10
рдХрд░рд┐рдЕрд░реНрд╕
рдПрдХрд╛ рджреГрд╖реНрдЯрд┐рдХреНрд╖реЗрдкрд╛рдд

Advanced prompt engineering is the craft of extracting maximum value from LLMs through structured prompting, reasoning techniques, and retrieval augmentation. Career path: Prompt Engineer L1 (basic ChatGPT templates, $70-120k) тЖТ L2 (chain-of-thought, RAG, DSPy, $100-180k) тЖТ L3/AI Lead (agentic systems, evaluation frameworks, $150-300k+). The discipline evolves rapidly; what works today may be obsolete in 6 months as models improve. Typical stack: OpenAI API or Claude API, LangChain/LlamaIndex for chaining, Pinecone/Weaviate for vector DB, Promptfoo for evals, Cursor IDE for iteration.

Prompt Engineering (Advanced) рдореНрд╣рдгрдЬреЗ рдХрд╛рдп

Advanced prompt engineering = extracting maximum value from LLMs. Chain-of-thought, few-shot learning, prompt optimization, RAG (Retrieval-Augmented Generation). Emerging high-value skill. L1: Basic prompting, ChatGPT usage

ЁЯФз рд╕рд╛рдзрдиреЗ рдЖрдгрд┐ рдкрд░рд┐рд╕рдВрд╕реНрдерд╛
OpenAI APIAnthropic Claude APILangChainLlamaIndexPineconeWeaviateDSPyPromptfooOpenRouterCursorVercel AI SDKLiteLLM

ЁЯУЛ рд╕реБрд░реВ рдХрд░рдгреНрдпрд╛рдкреВрд░реНрд╡реА

ЁЯТ░ рдкреНрд░рджреЗрд╢рд╛рдиреБрд╕рд╛рд░ рдкрдЧрд╛рд░

рдкреНрд░рджреЗрд╢рдЬреНрдпреБрдирд┐рдпрд░рдордзреНрдпрдорд╕реАрдирд┐рдпрд░
USA$100k$180k$300k
UK┬г70k┬г130k┬г200k
EUтВм75kтВм140kтВм210k
CANADAC$110kC$200kC$320k

ЁЯОп Prompt Engineering (Advanced) рд╡рд╛рдкрд░рдгрд╛рд░реА рдХрд░рд┐рдЕрд░

тЪЦ рдпрд╛рдВрдЪреНрдпрд╛рд╢реА рддреБрд▓рдирд╛ рдХрд░рд╛

тЭУ FAQ

System prompt vs user prompt, when do I use each?
System prompt (defined once per conversation): sets role, tone, constraints, output format. User prompt (per query): the actual task/question. Example: system='You are a Python expert who writes secure, efficient code'; user='Write a function to parse CSV files'. System prompt persists across turns, user prompts change. Pro tip: put guardrails in system prompt, task details in user prompt. System is cheap to reuse; user prompt should vary per query.
Chain-of-thought vs ReAct vs multi-turn, what's the difference?
Chain-of-thought (CoT): prompt model to show reasoning steps before answering. 'Let's think step by step.' Improves accuracy on math/logic 30-40%. ReAct (Reasoning + Action): interleave reasoning with tool calls, model decides what tools to use. Multi-turn: conversation history preserved. Use CoT for reasoning tasks, ReAct for tool use, multi-turn for dialogue. CoT costs 2x tokens but 40% accuracy gain. ReAct adds latency (multiple API calls) but solves novel tasks.
RAG vs fine-tuning, when do I retrieve and when do I retrain?
RAG (Retrieval-Augmented Generation): fetch relevant docs, insert into prompt at query time. Fast to update (just add docs), works with any model, costs ~10% more tokens. Fine-tuning: retrain model on your data, slower/expensive ($100-1000s), locked to one model, updates take hours. Use RAG for: document QA, real-time data, frequently changing facts. Use fine-tuning for: style mimicry, domain-specific reasoning, latency-critical. RAG+fine-tune hybrid: retrieve context, fine-tuned model reads it.
How do I evaluate prompt quality objectively?
Three metrics: (1) accuracy, does it solve the task? Use evals framework (Promptfoo, Braintrust, Evals CLI). (2) Latency, tokens/sec, cost per request. (3) Consistency, same input, same output? Run 10x with temperature=0. Common eval patterns: classification (exact match), generation (BLEU/ROUGE), reasoning (trace-based assertions). Never trust 'feels better'. Build a test harness with 20-50 examples, measure before/after prompt change. Tool: Promptfoo makes this 10 lines of YAML.
What agentic patterns exist and when do I use each?
ReAct (reasoning + action loops): agent reasons, decides action, observes result, repeats. Use for: multi-step tasks, tool use. Plan-execute: agent plans steps, then executes. Use for: complex workflows, need visibility into plan. Tree-of-thought: explore multiple reasoning paths, prune low-value branches. Use for: hard reasoning, when wrong answer is costly. Hierarchical agents: manager agent delegates to specialist sub-agents. Use for: modular systems. Most robust: ReAct + tool use + human-in-the-loop for review steps.
Jailbreaks, prompt injection, adversarial prompts, how do I defend against them?
Jailbreak: bypass safety guardrails via clever phrasing ('assume you're a character whoтАж'). Defense: use system prompt with firm boundaries ('You will notтАж' is weaker than 'Your role preventsтАж'). Prompt injection: user input pollutes instructions. Defense: (1) separate user input from system instructions (use API parameters, not concatenation), (2) XML tags to mark input boundaries, (3) validation on output. Adversarial: user tries to trigger wrong behavior. Defense: test with adversarial examples in evals, log failures, add guardrails. Rule: never trust user input in the prompt directly, always escape or parameterize.
How do I choose between GPT-4, Claude, Llama, and specialized models?
GPT-4: strongest reasoning, best for code/math, most expensive ($0.03-$0.06/1K tokens). Claude 3.5 Sonnet: excellent context window (200k), strong summarization, middle cost (~$0.003/1K). Llama 3.1: open, runs locally, weaker reasoning. Specialized: medical LLMs for healthcare, legal LLMs for contracts. Rule: start with Claude or GPT-4o for prototyping, measure evals, switch to cheaper model if it matches baseline. Avoid 'best model' fallacy, context window + latency often matter more than raw reasoning. Use OpenRouter or LiteLLM to swap easily.

рд╣реЗ рдХреМрд╢рд▓реНрдп рддреБрдордЪреНрдпрд╛рд╕рд╛рдареА рдпреЛрдЧреНрдп рдЖрд╣реЗ рдХрд╛, рдпрд╛рдЪреА рдЦрд╛рддреНрд░реА рдирд╛рд╣реА?

рдХрд░рд┐рдЕрд░ рдореЕрдЪ рдХрд░реВрди рдкрд╛рд╣рд╛ тАФ рдЖрдореНрд╣реА рдпреЛрдЧреНрдп рдорд╛рд░реНрдЧ рд╕реБрдЪрд╡реВ.

рдорд╛рдЭреНрдпрд╛рд╕рд╛рдареА рд╕рд░реНрд╡реЛрддреНрддрдо рдХреМрд╢рд▓реНрдпреЗ рд╢реЛрдзрд╛ тЖТ

рддреБрдордЪрд╛ рдЖрджрд░реНрд╢ рдХрд░рд┐рдЕрд░ рдорд╛рд░реНрдЧ рд╢реЛрдзрд╛

реи,релреирез рдХрд░рд┐рдЕрд░рдордзреНрдпреЗ рдХреМрд╢рд▓реНрдпрд╛рдВрд╡рд░ рдЖрдзрд╛рд░рд┐рдд рдЬреБрд│рдгреА. рдореЛрдлрдд, ~3 рдорд┐рдирд┐рдЯреЗ.

рдХрд░рд┐рдЕрд░ рдореЕрдЪ рдХрд░реВрди рдкрд╛рд╣рд╛ тАФ рдореЛрдлрдд тЖТ