Prompt engineering is the practice of designing input instructions that reliably guide a language model toward a desired response. A prompt communicates the task, supplies context, defines the problem, and can require an output format. This matters because a general-purpose model may otherwise return answers that are generic, ambiguous, or irrelevant. section 5.3 section 5.3.1 section 5.3.2
Treat the model like a knowledgeable but literal assistant: state what it should do, include the information it should use, and specify how the answer should be organized. A request for Paris hotels can become a more useful result by explicitly asking for location considerations, price ranges, tourist areas, transportation access, and clear sections. section 5.3.1 section 5.3.2
# More structured prompt (better) structured_prompt = """ Provide information about hotels in Paris, including: - Location considerations - Price ranges - Popular areas for tourists - Transportation access Please format the response in clear parts""" Output: Location Considerations When choosing a hotel in Paris, consider the following factors: Proximity to Attractions: Staying near major attractions like the Eiffel Tower, Louvre Museum, or Notre-Dame Cathedral can save you travel time. The 1st, 4th, 5th, and 7th arrondissements are particularly central. Neighborhood Vibe: Each Parisian neighborhood, or arrondissement, has its own character. The Marais (3rd and 4th arrondissements) is trendy and historic, while Montmartre (18th arrondissement) offers a bohemian feel. Saint-Germain-des-Prés (6th arrondissement) is known for its intellectual and artistic heritage. Safety: Paris is generally safe, but like any major city, it's wise to stay in well-lit, populated areas. Central districts are typically safer. Price Ranges Hotel prices in Paris can vary widely based on location, season, and amenities: Budget Hotels: Prices can start as low as €50-€100 per night. These are often found in less central areas or smaller, family-run establishments. Mid-Range Hotels: Expect to pay between €100-€250 per night. These hotels offer more amenities and are often located in central areas. Luxury Hotels: Prices can range from €250 to over €1,000 per night. These hotels offer premium services and are often located in prime locations, such as near the Champs-Élysées or in the 1st arrondissement. Popular Areas for Tourists The Marais (3rd and 4th Arrondissements): Known for its historic architecture, boutique shopping, and vibrant nightlife. It's a favorite for those who enjoy a lively atmosphere. Saint-Germain-des-Prés (6th Arrondissement): Offers a blend of historic charm and modern luxury, with plenty of cafes, art galleries, and high-end shops. Latin Quarter (5th Arrondissement): Famous for its student life, historic sites, and lively atmosphere. It's home to the Sorbonne University and the Panthéon. Montmartre (18th Arrondissement): Known for its artistic history, this area offers stunning views of the city from the Sacré-Cœur Basilica. Transportation Access Paris has an extensive public transportation system, making it easy to get around: Metro: The Paris Metro is efficient and covers most of the city. Staying near a metro station can significantly enhance your mobility. RER Trains: Useful for reaching destinations outside the city center, such as Versailles or Disneyland Paris. Buses: Offer a scenic way to travel, though they can be slower due to traffic. Walking: Paris is a walkable city, especially in the central arrondissements. Many attractions are within walking distance of each other. Bicycles: The city has a bike-sharing system called Vélib', which is a convenient and eco-friendly way to explore. Conclusion When choosing a hotel in Paris, consider what you value most: proximity to attractions, budget, neighborhood vibe, or transportation access. Each arrondissement offers a unique experience, so think about what kind of atmosphere you want to enjoy during your stay. With a range of options available, you're sure to find a hotel that suits your needs and enhances your Parisian adventure.
Compare a broad hotel request with a structured instruction that names required topics and a response format; the latter yields an organized, more actionable answer. section 5.3.1
Choose a prompting pattern to fit the task:
- Use zero-shot prompting when a direct instruction is enough and the model can rely on its pre-trained knowledge. It may be inconsistent for complex or nuanced requests. section 5.3.2
- Use few-shot prompting when examples can demonstrate the response pattern, style, or structure to follow. section 5.3.2
- Use chain-of-thought prompting when the task benefits from reasoning through intermediate steps, such as evaluating retrieved hotel results against location, food, and review evidence. section 5.3.2
Ground a hotel recommendation in retrieved results
Provide the user query and hotel search results, then ask which option best matches the request, require pros and cons supported by review quotes, identify recurring themes, summarize the top choices, and give an overall recommendation. The prompt turns retrieval output into a constrained analysis rather than an unsupported general answer. section 5.3.2
Prompt engineering improves control and usefulness, not factual guarantees. Language models can hallucinate facts, combine information inconsistently, and make mathematical errors. For high-stakes answers, treat generated output as something to check against provided or retrieved evidence rather than as inherently correct. section 5.5 section 5.7


















































