Prompting for Business using Llama 2

Jerry Cuomo
5 min readAug 24, 2023

--

Think A.I. by Jerry Cuomo: Article Series 2023

Llama2, the recent marvel in the language model universe, offers businesses an opportunity to optimize their communication, streamline processes, and even craft more imaginative content. Highlighting Llama2’s growing importance in the business domain, IBM has unveiled plans to include Meta’s Llama2-chat, a 70 billion parameter model, with their watsonx.ai platform.

Given its formidable abilities, grasping the optimal ways to leverage Llama2 for business applications is crucial. This piece offers guidance on adeptly deploying Llama2 within your organization.

Variants of Llama2

Meta provides three versions of the Llama 2 model, each offering a balance between size/performance and the quality of outcomes.

Llama 2 7b: A swift model best for quick tasks like data categorization and brief summaries. Ideal for businesses needing fast results.

Llama 2 13b: The mid-tier option, balancing speed and depth. Great for content creation, marketing, and nuanced customer interactions.

Llama 2 70b: The most advanced in the series, designed for comprehensive tasks, data analysis, and software coding, showcasing the pinnacle of AI capabilities.

Llama 2 comes in two configurations: chat and base. While the chat variant has been optimized for conversations, making it a preferred choice for chatbot applications, the base model, though not evidently superior in a particular area, offers versatility and can address specific business needs.

A Glimpse into Llama2’s Capabilities

Based on insights from the Llama2 research paper, it’s clear that the model excels in handling a diverse range of business-focused prompts:

Creative Writing: Draft a marketing campaign for a sustainable product.

Identity/Personas: You’re positioned as a financial advisor. Explain the significance of portfolio diversification.

Factual Questions: What is the origin of the SWOT analysis?

Professional Development: I’m attending virtual meetings all day. How can I prevent digital burnout?

Advice & Recommendations: My company’s productivity is dwindling. How can we boost team morale?

Reasoning (math/problem-solving): If a company’s revenue grew by 15% from $1 million, what is the new revenue?

Llama2 vs. ChatGPT: A Business Perspective

While Llama2 is observed to be more descriptive and imaginative, ChatGPT provides concise responses. Llama2’s open-source nature means you have control over the code and weights. This autonomy ensures that the model remains consistent, and your data remains private, given you can run Llama2 locally.

Furthermore, while GPT-3.5 boasts around 175 billion parameters compared to Llama 2’s 70 billion, Llama2 effectively does more with fewer resources.

The Llama research paper details multiple benchmarks. One of these compares Llama 2 70b with GPT (gpt-3.5-turbo) including human-based response evaluation. The outcomes are presented in terms of win rates below, shows Llama 2 accelerating in Dialogue, Factual Questions and Recommendations.

Image from: A guide to prompting Llama 2 — see reference section below

The Power of System Prompts

In the corporate landscape, precision and tailored communication are vital. System prompts serve as strategic tools in guiding Llama2’s responses, ensuring they align with your business’s unique needs. For instance, if you’re rolling out a chatbot for a technical customer support portal, a simple system prompt like “You are addressing informed technical professionals” can be a game-changer. It ensures Llama2 aligns its feedback with the sophistication and specificity your clientele expects.

For businesses aiming for a customized user experience without resorting to model fine-tuning, system prompts are your go-to solution. They not only define Llama2’s persona but also set the tone and boundaries for its interactions. Common business-centric directives might include:

Technical Documentation: You are an API documentation assistant. Always provide responses in JSON format. No explanations needed.

Corporate Voice & Tone: Respond with a corporate-professional tone.

International Business: Answer in French.

Sensitive Topics: Avoid mentioning any controversial topics or names.

Historical Analysis: The year is… Provide insights from that business era.

Technical Support: You are a tech support chatbot. Address queries assuming the user has advanced technical knowledge.

Industry-specific Interest: My focus is on architectural innovations. If pertinent, recommend related industry insights.

Ghost Attention: Enhancing Memory Retention

I found a particular insight from the Llama 2 research paper intriguing. Early iterations of the model grappled with retaining the system prompt after several dialogue interactions. To remedy this, researchers incorporated the Ghost Attention (GAtt) technique. Thanks to GAtt, Llama 2’s ability to remember crucial system prompt details during extended conversations has seen significant enhancement. Yet, after about 20 dialogue interactions, there’s a possibility the model might miss out on some context, emphasizing the importance of brief and direct exchanges.

Strategies for Prompt Optimization

When using Llama2, the key to success lies in creating effective prompts that lead to accurate and relevant feedback. Here are some strategies to improve your experience with this advanced tool:

Calibrating Temperature: By tweaking the temperature, you influence the model’s output variability. A higher setting fosters diverse responses, whereas a lower setting yields more predictable answers.

Streamlining System Prompts: For analytical tasks or straightforward counts, using concise system prompts such as “You are a supportive aide” can enhance result accuracy.

Sequential Thinking Encouragement: Guiding Llama2 to process information step by step, or offering an exemplar can garner more precise outcomes.

Leveraging Llama2 APIs: For interactive chat solutions, wrapping user commands between [INST] and [/INST] markers can effectively pinpoint user instructions. Remember, Llama2 has a processing capacity of roughly 3,000 words in a go, so ensure chat sequences remain within this boundary.

In Conclusion

Harnessing Llama2’s capabilities can revolutionize business communication and process automation. By effectively structuring prompts — including the system prompt, adjusting the temperature, and guiding the model, businesses can optimize their interactions with Llama2.

The Art of AI for Business Podcast

If you’ve enjoyed this article, it’s likely you will also enjoy my Art of AI for business podcast. Check it out here.

References:

  • Llama 2: Open Foundation and Fine-Tuned Chat Models, July 19, 2023, Meta, Gen.AI team. Link
  • A guide to prompting Llama 2, August 14, 2023, Charlie Holtz, @cbh123. Link
  • IBM Plans to Make Llama 2 Available within its Watsonx AI and Data Platform, Aug 9, 2023, Link

--

--

Jerry Cuomo

IBM Fellow & CTO. Innovator and instigator of AI, Automation, Blockchain, Cloud at IBM. Husband, Dad, and Bass Player.