15 Prompts for Working with LLMs: Fine-Tuning, RAG, and Prompt Engineering

Introduction

Large Language Models (LLMs) have become the backbone of modern AI applications, but getting them to perform exactly what you need—whether it's answering questions from your private documents, generating code, or summarizing reports—requires more than just typing a question. You need a structured approach: fine-tuning to adapt the model to your domain, Retrieval-Augmented Generation (RAG) to ground answers in factual data, and prompt engineering to control output without retraining. This article provides 15 ready-to-use prompts across three categories (Basic, Advanced, Expert), each with a concrete task, the prompt itself, and a real-world example result. You can copy-paste these into your LLM workflow today.


Basic Prompts (5 Prompts)

These prompts are for users who are new to LLM interaction. They focus on simple instructions, clear formatting, and minimal context.

1. Task: Summarize a technical article in three bullet points.

  • Prompt: "You are a technical writer. Summarize the following article in exactly three concise bullet points. Focus on the main findings, methodology, and practical implication. Article: {paste article text}"
  • Example Result:
  • Finding: The new fine-tuning method reduces training time by 40% while maintaining accuracy.
  • Methodology: Used LoRA adapters on a frozen base model with only 2% of trainable parameters.
  • Implication: Small teams can now fine-tune 7B models on a single GPU.

2. Task: Extract key entities (people, companies, dates) from a text.

  • Prompt: "Extract all named entities from the following text. Return them as a JSON object with keys: 'persons', 'organizations', 'dates'. Example: {\"persons\": [\"John Doe\"], \"organizations\": [\"OpenAI\"], \"dates\": [\"2025-03-01\"]}. Text: {paste text}"
  • Example Result:
    json { "persons": ["Alice Johnson"], "organizations": ["Google", "Anthropic"], "dates": ["2026-07-15"] }

3. Task: Rewrite a paragraph in a professional tone.

  • Prompt: "Rewrite the following casual paragraph in a professional, business-appropriate tone. Use formal language, avoid slang, and keep the same meaning. Paragraph: {paste casual text}"
  • Example Result:
  • Original: "Hey, so we tried the new model and it works pretty well, but sometimes it messes up."
  • Rewritten: "We have tested the new model and observed satisfactory performance, though occasional errors have been noted."

4. Task: Create a simple FAQ from a product description.

  • Prompt: "Based on the product description below, generate a FAQ with 5 questions and answers. Use a Q&A format. Description: {paste product description}"
  • Example Result:
  • Q: What is the maximum context length? A: The model supports up to 128K tokens.
  • Q: Is the model open-source? A: Yes, it is released under Apache 2.0.

5. Task: Translate a sentence from English to French, then explain the translation.

  • Prompt: "Translate the following English sentence to French. Then, provide a brief explanation of why you chose each word or phrase. Sentence: 'The quick brown fox jumps over the lazy dog.'"
  • Example Result:
  • Translation: "Le renard brun rapide saute par-dessus le chien paresseux."
  • Explanation: 'Le renard' is masculine singular; 'brun' and 'rapide' agree in gender and number; 'saute' is the third-person singular present of 'sauter'.

Advanced Prompts (5 Prompts)

These prompts require understanding of LLM capabilities like chain-of-thought, role-playing, and structured output. They are ideal for developers and data scientists.

6. Task: Generate a chain-of-thought reasoning for a math problem.

  • Prompt: "Solve the following problem step-by-step. Show your reasoning in a clear chain-of-thought format. Problem: A store sells apples at $0.50 each and oranges at $0.75 each. If a customer buys 3 apples and 2 oranges, what is the total cost?"
  • Example Result:
  • Step 1: Cost of apples = 3 * $0.50 = $1.50
  • Step 2: Cost of oranges = 2 * $0.75 = $1.50
  • Step 3: Total cost = $1.50 + $1.50 = $3.00

7. Task: Write a Python function to query a RAG system.

  • Prompt: "You are an expert Python developer. Write a function query_rag(question: str, vector_store: object) -> str that takes a user question and a vector store (with a similarity_search method), retrieves the top 3 relevant documents, and uses a language model (like OpenAI's API) to generate an answer based on those documents. Include error handling and comments."
  • Example Result:
    python import openai def query_rag(question, vector_store): try: docs = vector_store.similarity_search(question, k=3) context = "\n\n".join([doc.page_content for doc in docs]) prompt = f"Answer the question based on the context.\nContext: {context}\nQuestion: {question}" response = openai.ChatCompletion.create(model="gpt-4", messages=[{"role": "user", "content": prompt}]) return response.choices[0].message.content except Exception as e: return f"Error: {str(e)}"

8. Task: Create a system prompt for a fine-tuned customer support bot.

  • Prompt: "Design a system prompt for a fine-tuned LLM that acts as a customer support agent for a SaaS company. The prompt should include: the bot's role, tone (friendly but professional), knowledge cut-off date, instructions to escalate if needed, and a prohibition against making up information. Use the following template: 'You are [role]. Your tone is [tone]. Your knowledge is current as of [date]. Follow these rules: [rules].'"
  • Example Result:
  • "You are a customer support agent for CloudSync Inc. Your tone is friendly, empathetic, and professional. Your knowledge is current as of July 2026. Rules: 1) Only answer based on provided documentation. 2) If you don't know, say 'I don't have that information' and offer to transfer to a human. 3) Never invent product features. 4) Always ask for the user's account ID first."

9. Task: Generate a fine-tuning dataset in JSONL format.

  • Prompt: "Create a JSONL dataset for fine-tuning a model to classify customer feedback into categories: 'positive', 'negative', 'neutral'. Generate 5 examples. Each line should be a JSON object with 'prompt' and 'completion' fields. Use the format: {\"prompt\": \"Classify the feedback: \n###\n\", \"completion\": \"
  • Example Result:
    jsonl {"prompt": "Classify the feedback: The product is amazing!\\n###\\n", "completion": " positive"} {"prompt": "Classify the feedback: Terrible experience, will not buy again.\\n###\\n", "completion": " negative"} {"prompt": "Classify the feedback: It works as expected.\\n###\\n", "completion": " neutral"} {"prompt": "Classify the feedback: Fast delivery but poor packaging.\\n###\\n", "completion": " negative"} {"prompt": "Classify the feedback: Good value for the price.\\n###\\n", "completion": " positive"}

10. Task: Write a prompt that enforces a specific output format (JSON schema).

  • Prompt: "Generate a JSON object describing a book. Use this exact schema: {\"title\": string, \"author\": string, \"year\": integer, \"genres\": [string], \"rating\": float between 1.0 and 5.0}. Example: {\"title\": \"Dune\", \"author\": \"Frank Herbert\", \"year\": 1965, \"genres\": [\"Science Fiction\"], \"rating\": 4.5}. Now describe the book 'Neuromancer' by William Gibson."
  • Example Result:
    json { "title": "Neuromancer", "author": "William Gibson", "year": 1984, "genres": ["Science Fiction", "Cyberpunk"], "rating": 4.3 }

Expert Prompts (5 Prompts)

These prompts involve advanced techniques such as multi-turn reasoning, dynamic context injection, and integration with external tools. They are for experienced AI engineers and researchers.

11. Task: Use a prompt to simulate a ReAct (Reasoning + Acting) agent for a search task.

  • Prompt: "You are a ReAct agent. You have access to a 'search' tool that returns the top result from a knowledge base. For each user query, follow this format:
    Thought: (what you need to find)
    Action: search[query]
    Observation: (result from search)
    ... (repeat as needed)
    Answer: (final answer)
    User query: 'What is the capital of France and its population?'"
  • Example Result:
  • Thought: I need to find the capital of France first.
  • Action: search[capital of France]
  • Observation: Paris
  • Thought: Now I need the population of Paris.
  • Action: search[population of Paris 2026]
  • Observation: Approximately 2.1 million
  • Answer: The capital of France is Paris, with a population of about 2.1 million.

12. Task: Create a prompt that injects dynamic context from a RAG system.

  • Prompt: "You are a research assistant. Given the following context from a vector database, answer the user's question. If the context does not contain the answer, say 'I cannot find this in the provided documents.' Context: {retrieved_documents}. Question: {user_question}. Answer concisely."
  • Example Result:
  • Context: [Document 1: 'LLMs can be fine-tuned using LoRA...', Document 2: 'RAG combines retrieval with generation...']
  • Question: 'What is LoRA?'
  • Answer: 'LoRA (Low-Rank Adaptation) is a fine-tuning method that adds small trainable matrices to a frozen base model, reducing memory usage.'

13. Task: Write a meta-prompt that generates evaluation criteria for model outputs.

  • Prompt: "You are an AI evaluator. Given a task description and a set of model outputs, generate a list of 5 evaluation criteria with a 1-5 scale. For each criterion, provide a definition and an example of a high-score and low-score output. Task: Summarize news articles. Outputs: [list of summaries]. Generate the criteria in JSON format."
  • Example Result:
    json { "criteria": [ { "name": "Accuracy", "definition": "How correctly the summary reflects the article's facts.", "high_score_example": "The summary correctly states the date and event.", "low_score_example": "The summary invents a statistic." }, { "name": "Conciseness", "definition": "How well the summary captures key points in few words.", "high_score_example": "3 sentences cover main points.", "low_score_example": "10 sentences with redundant details." } ] }

14. Task: Design a prompt for iterative code generation with self-correction.

  • Prompt: "You are a code assistant. Write a Python function to calculate the Fibonacci sequence up to n. After writing it, test it with n=10. If it fails, fix the code and explain the error. Output the final code and test result."
  • Example Result:
  • Initial code: def fib(n): return n if n <= 1 else fib(n-1) + fib(n-2)
  • Test: fib(10) returns 55. Correct.
  • (If there was an error, e.g., recursion limit, the prompt would trigger correction.)

15. Task: Create a prompt that orchestrates a multi-agent collaboration (simulated).

  • Prompt: "You are a project manager for three AI agents: a Writer, a Reviewer, and a Editor. The user provides a topic. First, the Writer drafts a 100-word paragraph. Then, the Reviewer critiques it for clarity and accuracy. Finally, the Editor produces a final version incorporating feedback. Simulate all three roles in sequence.
    Topic: Benefits of fine-tuning LLMs."
  • Example Result:
  • Writer: 'Fine-tuning adapts a pre-trained LLM to a specific domain...'
  • Reviewer: 'The paragraph is clear but lacks specific examples of techniques like LoRA.'
  • Editor: 'Fine-tuning adapts a pre-trained LLM to a specific domain, using methods like LoRA to reduce computational cost. For example, a medical model can be fine-tuned on clinical notes to improve diagnostic accuracy.'

Conclusion

Mastering prompts for fine-tuning, RAG, and prompt engineering is not about memorizing magic phrases—it's about understanding the structure of tasks and how to communicate them precisely to an LLM. Start with the basic prompts to build confidence, then move to advanced patterns like chain-of-thought and schema enforcement. Finally, experiment with expert-level techniques such as ReAct agents and meta-prompts to build robust, production-ready systems. Try adapting these prompts to your own use cases, and you'll see immediate improvements in output quality and reliability.

This article is based on official documentation from OpenAI (platform.openai.com), Anthropic (docs.anthropic.com), and the LangChain framework (python.langchain.com).

← All posts

Comments