• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Home
  • Contact Us

iHash

News and How to's

  • Amysen Wi-Fi Smart Plug (4-Pack) for $23

    Amysen Wi-Fi Smart Plug (4-Pack) for $23
  • Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade A for $76

    Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade A for $76
  • FreeCast Value Channels: 1-Yr Subscription for $39

    FreeCast Value Channels: 1-Yr Subscription for $39
  • Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade B for $71

    Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade B for $71
  • Apple iPad 7th Gen (2019) 128GB Space Gray (Wi-Fi Only) Bundle with Beats Flex Headphones (Refurbished) for $299

    Apple iPad 7th Gen (2019) 128GB Space Gray (Wi-Fi Only) Bundle with Beats Flex Headphones (Refurbished) for $299
  • News
    • Rumor
    • Design
    • Concept
    • WWDC
    • Security
    • BigData
  • Apps
    • Free Apps
    • OS X
    • iOS
    • iTunes
      • Music
      • Movie
      • Books
  • How to
    • OS X
      • OS X Mavericks
      • OS X Yosemite
      • Where Download OS X 10.9 Mavericks
    • iOS
      • iOS 7
      • iOS 8
      • iPhone Firmware
      • iPad Firmware
      • iPod touch
      • AppleTV Firmware
      • Where Download iOS 7 Beta
      • Jailbreak News
      • iOS 8 Beta/GM Download Links (mega links) and How to Upgrade
      • iPhone Recovery Mode
      • iPhone DFU Mode
      • How to Upgrade iOS 6 to iOS 7
      • How To Downgrade From iOS 7 Beta to iOS 6
    • Other
      • Disable Apple Remote Control
      • Pair Apple Remote Control
      • Unpair Apple Remote Control
  • Special Offers
  • Contact us

Crafting Prompt Sandwiches for Generative AI

Aug 2, 2023 by iHash Leave a Comment



,

Large Language Models (LLMs) can give notoriously inconsistent responses when asked the same question multiple times. For example, if you ask for help writing an Elasticsearch query, sometimes the generated query may be wrapped by an API call, even though we didn’t ask for it. This sometimes subtle, other times dramatic variability adds complexity when integrating generative AI into analyst workflows that expect specifically-formatted responses, like queries. In the short term, LLM providers may offer a patchwork of vendor-specific techniques for improving the repeatability of responses.

Fortunately, in addition to these emerging vendor-specific techniques, there’s a universal pattern for structuring prompts at the start of a conversation to steer it in the right direction. We’ll craft a prompt sandwich to improve the quality and consistency of chats with your preferred LLM. We’ll explore the parts of a prompt sandwich and illustrate its practical application in the Elastic AI Assistant.

https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt432f5a33601f516a/64c93cd6a3f81b3b2f51929a/elastic-blog-1-adalle-ai.jpg,elastic-blog-1-adalle-ai.jpg,

The Elastic AI Assistant integrates Elastic Security detection alerts, events, rules, and data quality checks as context for generative AI chats. The assistant helps make prompt sandwiches and reduces privacy risks through field-level pseudonymization of values.

_________________________________________________
/ \
| You are an expert in Elastic Security. | (1)
\ _______________________________________________/
+————————————————+
| I have an alert for a user named alice. | (2)
+————————————————+
/ \
| How should I investigate it? | (3)
\_______________________________________________/,

Each layer of the prompt sandwich has a name and specific purpose:

  1. System prompt

  2. Context

  3. User prompt

Each layer’s unique purpose is outlined below:

,

Purpose

Example

System prompt

Steers the conversation and role of the assistant

You are an expert in Elastic Security.

Context

Data or metadata, which may be structured or freeform

I have an alert for a user named alice.

User prompt

Asks a question or makes a request

How should I investigate it?

,

When building and tuning prompts for repeatability, this three-layered format provides guidance on structuring prompts and which parts to modify first.

https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc2eafab222154714/64c93ed785f91b7703336ead/elastic-blog-2-chat-button.jpg,elastic-blog-2-chat-button.jpg,

The three layers of the prompt sandwich — (1) System prompt, (2) Context, and (3) User prompt — are labeled in the screenshot below.

https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt18be903fe82af6f7/64c93f0002b0387127168a78/elastic-blog-3-annotated.jpg,elastic-blog-3-annotated.jpg,

Before any data is sent to the LLM, you may use the Elastic AI Assistant’s inline editing prompt preview (as shown above) to:

  • Add new, edit, or remove system prompts
  • Add additional context, remove context, and for some types of data, configure field level anonymization
  • Preview or edit user prompts selected via the Quick prompts feature

Custom system prompts and user prompts are optionally created via the settings shown in the screenshot below:

https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc1038ea9ca07312e/64c93f32c53087b6e1bc3470/elastic-blog-4-system-prompts.jpg,elastic-blog-4-system-prompts.jpg,

The Settings view above also configures the defaults for data anonymization.

https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltd14f52285f53aafb/64c93f91ec43999f83ea15d4/elastic-blog-5-values.jpg,elastic-blog-5-values.jpg,

In the example above, the values of three fields will be anonymized when they are sent to the LLM. You may accept the configured defaults or interact with the preview to toggle specific fields.

,

Above: The Show anonymized toggle reveals the anonymized data sent and received from the LLM.

,

The release and timing of any features or functionality described in this post remain at Elastic’s sole discretion. Any features or functionality not currently available may not be delivered on time or at all.

In this blog post, we may have used third party generative AI tools, which are owned and operated by their respective owners. Elastic does not have any control over the third party tools and we have no responsibility or liability for their content, operation or use, nor for any loss or damage that may arise from your use of such tools. Please exercise caution when using AI tools with personal, sensitive or confidential information. Any data you submit may be used for AI training or other purposes. There is no guarantee that information you provide will be kept secure or confidential. You should familiarize yourself with the privacy practices and terms of use of any generative AI tools prior to use.

Elastic, Elasticsearch and associated marks are trademarks, logos or registered trademarks of Elasticsearch N.V. in the United States and other countries. All other company and product names are trademarks, logos or registered trademarks of their respective owners.



Source link

Share this:

  • Facebook
  • Twitter
  • Pinterest
  • LinkedIn

Filed Under: News Tagged With: Crafting, generative, Prompt, Sandwiches

Special Offers

  • Amysen Wi-Fi Smart Plug (4-Pack) for $23

    Amysen Wi-Fi Smart Plug (4-Pack) for $23
  • Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade A for $76

    Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade A for $76
  • FreeCast Value Channels: 1-Yr Subscription for $39

    FreeCast Value Channels: 1-Yr Subscription for $39
  • Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade B for $71

    Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade B for $71
  • Apple iPad 7th Gen (2019) 128GB Space Gray (Wi-Fi Only) Bundle with Beats Flex Headphones (Refurbished) for $299

    Apple iPad 7th Gen (2019) 128GB Space Gray (Wi-Fi Only) Bundle with Beats Flex Headphones (Refurbished) for $299

Reader Interactions

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

  • Facebook
  • GitHub
  • Instagram
  • Pinterest
  • Twitter
  • YouTube

More to See

Customize your data ingestion with Elastic input packages

Customize your data ingestion with Elastic input packages

Oct 1, 2023 By iHash

Video Highlights: Vicuña, Gorilla, Chatbot Arena and Socially Beneficial LLMs — with Prof. Joey Gonzalez

Oct 1, 2023 By iHash

Tags

* Apple attacks Cisco computer security cyber attacks cyber crime cyber news cybersecurity Cyber Security cyber security news cyber security news today cyber security updates cyber threats cyber updates data data breach data breaches google hacker hacker news Hackers hacking hacking news how to hack incident response information security iOS 7 iOS 8 iPhone Malware microsoft network security ransomware ransomware malware risk management security security breaches security vulnerabilities software vulnerability the hacker news Threat update video web applications

Latest

Amysen Wi-Fi Smart Plug (4-Pack) for $23

Expires October 03, 2123 07:59 PST Buy now and get 52% off KEY FEATURES Introducing the Amysen smart plug – your ultimate home automation solution. Compatible with Alexa and Google Assistant, this smart plug allows for voice control and seamless integration with your smart home ecosystem. The schedule feature enables you to set specific times […]

Refurbished Apple iPad 4 (2012) WiFi Black / 16GB / Grade A for $76

Expires April 01, 2028 09:00 PST Buy now and get 23% off PRODUCT SPECS With the iPad 4th Generation from Apple, you can do more than ever. The iPad 4 has a stunning 9.7 inch Retina display that makes text razor sharp, photos rich in detail and enhances the overall experience with crisp imagery. With […]

Swift 5.9 Released

Swift 5.9 is now available! 🎉 This is a major new release that adds an expressive macro system to the language and introduces support for integrating Swift into C++ codebases through bidirectional interoperability. It also introduces parameter packs, an improved expression evaluator while debugging, enhanced crash handling, Windows platform improvements, and more. Read on for […]

Our 7 Favorite Observability Podcasts

Our 7 Favorite Observability Podcasts

This coming Saturday, Sept. 30, is International Podcast Day. It’s a medium that as little as 15 years ago had a very small footprint in the information landscape. Now, it’s hard to imagine our lives without them. Whether you want to get informed on a current event, discover stories of the past that may have […]

Debugging Improvements in Swift 5.9

September 28, 2023 Adrian Prantl manages the Debugger Compiler Integration team at Apple. He works on debug info in the compiler and the Swift plugin in LLDB. Augusto Noronha works on Swift debugging and is a member of the Debugger Compiler Integration team at Apple. Dave Lee works on Swift debugging as a member of […]

Beware of scammers! Dangerous apps in the App Store

Beware of scammers! Dangerous apps in the App Store

Apple’s App Store is considered a reliable platform for downloading apps. So much so, in fact, that users often assume there’s no danger at all: what could possibly be wrong with an app that’s been moderated by Apple? App Store verification is indeed effective, and news about malicious or phishing apps on the platform is […]

Jailbreak

Pangu Releases Updated Jailbreak of iOS 9 Pangu9 v1.2.0

Pangu has updated its jailbreak utility for iOS 9.0 to 9.0.2 with a fix for the manage storage bug and the latest version of Cydia. Change log V1.2.0 (2015-10-27) 1. Bundle latest Cydia with new Patcyh which fixed failure to open url scheme in MobileSafari 2. Fixed the bug that “preferences -> Storage&iCloud Usage -> […]

Apple Blocks Pangu Jailbreak Exploits With Release of iOS 9.1

Apple has blocked exploits used by the Pangu Jailbreak with the release of iOS 9.1. Pangu was able to jailbreak iOS 9.0 to 9.0.2; however, in Apple’s document on the security content of iOS 9.1, PanguTeam is credited with discovering two vulnerabilities that have been patched.

Pangu Releases Updated Jailbreak of iOS 9 Pangu9 v1.1.0

  Pangu has released an update to its jailbreak utility for iOS 9 that improves its reliability and success rate.   Change log V1.1.0 (2015-10-21) 1. Improve the success rate and reliability of jailbreak program for 64bit devices 2. Optimize backup process and improve jailbreak speed, and fix an issue that leads to fail to […]

Activator 1.9.6 Released With Support for iOS 9, 3D Touch

  Ryan Petrich has released Activator 1.9.6, an update to the centralized gesture, button, and shortcut manager, that brings support for iOS 9 and 3D Touch.

Copyright iHash.eu © 2023
We use cookies on this website. By using this site, you agree that we may store and access cookies on your device. Accept Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT