This piece originally appeared in the Foreign Service Journal in June 2024. Making AI work at State...
Four Ways to Shape LLM Responses: A Basic Guide for Modern Diplomats
As more diplomats embrace generative AI tools, I've noticed some confusion about how best to deliver context to these systems. Let me decode four approaches I see diplomatic professionals using successfully, along with their practical benefits and limitations.
1. Prompts
Prompts are the most basic way to shape an LLM's response. They are the direct instructions or queries you provide to the model in a conversation.
- Being specific and clear about what you want
- Using examples to demonstrate the desired format
- Breaking complex tasks into steps
- Setting constraints like tone, length, or format
Prompts work in real-time within your conversation without any setup - making them incredibly accessible. However, their effectiveness hinges on your skill at crafting clear instructions, and you'll need to restate guidance frequently (both when starting new chats and sometimes within longer exchanges). This repetition can be tedious and increases the risk of inconsistent responses.
2. Instruction Files
Instruction files are persistent sets of guidelines that shape how an LLM responds across multiple conversations.
- Created once and applied consistently to all interactions
- More comprehensive than individual prompts
- Define the model's persona, capabilities, and limitations
- Establish consistent behavior across multiple interactions
The primary advantage is consistency across conversations. These files work harmoniously with your prompts - allowing you to establish general guidelines in the instruction file while providing specific guidance in each prompt. The tradeoff? Some initial setup time and occasional unexpected interactions between complex instructions and detailed prompts.
3. Documents in Context
Adding documents to a context window provides the LLM with specific information to reference when generating responses:
- Allows the model to access information beyond its training data
- Keeps responses grounded in specific content
- Enables the model to cite or reference specific documents
- Works well for specific questions about particular content
Some of my most productive AI collaborations have centered around discussions drawing from multiple documents. The key limitation is the context window size - paid ChatGPT Teams accounts offer about 350 pages, while Claude Plus offers approximately 500 pages. Remember that your entire conversation history consumes this space, so it diminishes quickly in extended exchanges.
4. Retrieval-Augmented Generation (RAG)
RAG systems take document reference to the next level by:
- Creates a knowledge base that exists outside the model
- Dynamically retrieves only the most relevant information based on your query
- Transcends context window limitations
- Enables access to much larger knowledge bases
RAG allows LLMs to reference virtually unlimited knowledge by pulling in only what's relevant to each specific query. They also create consistent knowledge sources across multiple instruction files and conversations - which sounds ideal in theory.
The reality? RAGs require significant technical knowledge, time, and specialized tools to implement properly. They also demand ongoing content curation and management. They make the most sense at the organizational level where multiple people need to update different information and the volume of content is substantial.
Making Your Choice
Most diplomatic professionals will benefit from mixing these approaches based on their specific needs. Consider these factors:
Scale and Persistence:
- Prompts: Temporary, conversation-specific
- Instructions: Persistent across a specific implementation
- Context Documents: Limited by context window size
- RAG: Can reference vast knowledge bases
Implementation Complexity:
- Prompts: Simplest, requiring no technical setup
- Instructions: Moderate setup for a specific application
- Context Documents: Simple upload process
- RAG: Most complex, requiring vector databases and retrieval systems
Flexibility vs. Consistency:
- Prompts: Highly flexible but potentially inconsistent
- Instructions: More consistent but less flexible
- Context Documents: Limited to specific uploaded content
- RAG: Most flexible for information access while maintaining consistency
What approaches have you found most effective in your diplomatic work? Which methods would you like to explore further?