OpenAI GPT in Depth - Questions and Misconceptions

Ivo Andreev
Ivo AndreevSystem Architect
OpenAI GPT in Depth
Misconceptions and questions you would like answered
The event for those who want to unlock the industrial potential with AI
We do not
focus on this
We focus
on this
Topics we will Safely Ignore
• Convolutional Neural Networks (CNN)
• Compare GPT-4 to 3.5 and Bard
• Art of prompt engineering
• Roles, perspective training
• Having fun with ChatGPT
• Plugins, generating content
Thanks to our Sponsors
• Solution Architect @
• Microsoft Azure & AI MVP
• External Expert Eurostars-Eureka, Horizon Europe
• External Expert InnoFund Denmark, RIF Cyprus
• Business Interests
o Web Development, SOA, Integration
o IoT, Machine Learning
o Security & Performance Optimization
• Contact
ivelin.andreev@kongsbergdigital.com
www.linkedin.com/in/ivelin
www.slideshare.net/ivoandreev
SPEAKER BIO
Upcoming Events
DataSaturday Sofia, 2023
Oct 7, 2023 @Sofia Tech Park
Tickets (Eventbrite)
Submit Session (Sessionize)
JS Talks
Nov 17-18, 2023 @Sofia Tech Park
Tickets (Eventbrite)
Submit Session (Sessionize)
Takeaways
• What is ChatGPT doing and why does it work
o https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/
• OpenAI Transparency Note, Limitations, Best Practices
o https://learn.microsoft.com/en-us/legal/cognitive-services/openai/transparency-note
• Sparks of General Intelligence in GPT-4 (Microsoft Research, Apr 2023)
o https://youtu.be/Oxyg5I167b0
• Prompts for Developers
o https://github.com/f/awesome-chatgpt-prompts
o (Course) ChatGPT Prompt Engineering for Developers (by OpenAI)
• OpenAI Cookbook(sample code for common tasks with the OpenAI API)
o https://github.com/openai/openai-cookbook/
You MUST read that one
And watch that one
Key Terms
TERM DEFINITION
Prompt The text you send to the service in the API call. This text is then input into the model.
Completion or Generation The text Azure OpenAI outputs in response.
Token Unit of text that the model uses to process and understand language
Text is processed by breaking it down into tokens. Tokens can be words or just chunks of characters.
• 1 token ~= 4 chars in English
• 100 tokens ~= 75 words
Few-shot prompting
One-shot prompting
Zero-shot prompting
Few examples show the model how to operate. Include several examples in the prompt that
demonstrate the expected answer format and content. (additional training)
Embedding Information dense representation of the semantic meaning of a piece of text.
Format is vector of floating point numbers
Recency Bias The order input is presented matters
Know your GPT
• ChatGPT for Enterprises (URL)
o Launched 2023.08.23
• Pricing
o Negotiate case-by-case
• Highlights
• Copyright Lawsuits
o Under attack by copyright holders
o Does CoPilot training on GitHub
violate open-source licenses?
• Microsoft Promise (URL)
o Microsoft would cover the cost for any copyright
violations that may arise from use (applies to M365
Copilot, Copilot and Bing Chat Enterprise)
Good to Know!
• All prompts result in completions
o Model completes the text
o Model replies with what it thinks is most likely to follow
• Large-scale language and image models can potentially behave in ways that
are unfair, unreliable, or offensive, in turn causing harms
• OpenAI models are trained primarily in English.
o Bias may have been introduced. Other languages are likely to have worse performance.
• Stereotyping
o DALL-E generation of homeless and fatherless may render images of predominantly Afro-Americans
• Information reliability
o Fabricate seemingly reasonable content that does not correspond to facts.
o Even training on trusted sources may fabricate content that misrepresent the sources
GPT – Advanced
Challenges
& Misconceptions
Top Questions (and Answers)
Q: Why does the same problem receive different answers for different users and under what conditions shall we
expect improvement to result in taking to the best answer and who decides on which is the best answer
• A: Models are designed to inject varying amounts of pseudo randomness into the response tokens that
are provided based on your parameters. This is particularly influenced by the temperature parameter.
o Temperature [0,1] - Controls the “creativity” or randomness of the text generated. A higher value will make the output more divergent (fictional)
o Prompt: Give me a creative response. (temperature=1.0)
Q: Is there a way to improve explainability - mainly the source at which the response is based (i.e. in Bing chat)
• A: For GPT-4 by itself, chain-of-thought prompting is a technique that can help increase the likelihood of
accurate answers, but it is not going to give you accurate source citations.
o …cite the reason behind the classification, using the format BEHAVIOR("reason")
o …Output format: {"TOPIC_NAME": "", "HEADLINES": [], "REASONING": ""}
o Answer in 100 words or less. Use bullet lists wherever possible.
Q: Why does Bing chat work differently?
• This is NOT Bing presenting its sources
• Chunks of text from Bing search sources added behind the scenes to the GPT-4 Chat Completion call
as part of the messages array. GPT-4 is not guaranteed to limit to present these sources
Manage the Conversation Efficiently
• Think in Tokens
o Common multisyllable words are a single token (i.e. dataset)
o Less common words or dates are broken into tokens (i.e. tuning, 2023/10/18)
o Tokenizer app: https://tokenization.azurewebsites.net/
• Context
o No memory, all information shall be present in the conversation
o Once the token count is reached the oldest messages iwill be removed (Quality degrades )
o Context = prompts + input + output
• Each model training increases the limit but such still exists
o GPT-3.5 (4’096 tokens), GPT-4 (8’192 tokens, 10 pages), GPT-4-32 (32’768 tokens, 40 pages)
o Option: limit the conversation duration to the max token length or a certain number of turns
o Option: summarize conversation until now and feed the summary as a prompt (details are lost)
Own data in GPT with AZ Search
• Own data for responses in ChatGPT (preview 2023.06.19)
o https://github.com/pablomarin/GPT-Azure-Search-Engine/blob/main/03-Quering-AOpenAI.ipynb
o https://github.com/Azure-Samples/azure-search-openai-demo/
o Inject own data using prompts (NO fine tuning and retraining)
• The Challenges
o Context limit is 4K (v3.5), 32K(v.4) tokens in a prompt
o Passing GBs of data as prompt is not possible
• Approach
o Keep all the data in an external knowledge base (KB)
o Retrieve fast from the KB (AZ Cognitive Search)
• Flow
o Determines what data to retrieve from data source (Cognitive Search) based on the user input
o Data augmented and appended to the prompt to the OpenAI model
o Resulting input processed like any other prompt by the model
Function Calling
• Available in Azure OpenAI (2023.07.20)
o gpt-35-turbo and gpt-4 can produce structured JSON outputs based on functions
o new API parameters in our /v1/chat/completions endpoint (functions, function_call)
Note: Completions API does not call the function; instead, the model generates JSON that you can use
• Purpose
o Solves inability of models to address online data
o Empowers developers to easily integrate external
tools and APIs
o Model recognizes situations where function call is
necessary and creates structured JSON output
• Retrieve from data sources (search indexes,
databases, APIs)
• Actions (write data to a database, call
integration APIs, send notifications)
Function Calling Tips
• Default Auto
o When functions are provided, by default the function_call will be set to "auto"
• Validate function calls
o verify the function calls generated by the model. – parameters, intended action
• Data from Trusted/Verified Sources
o Untrusted data in a function output could instruct model to write function calls in a not intended way
• Least Privilege Principle
o The minimum access necessary for the function to perform its job
o I.e. query a database – use R/O access to the database
• Consider Real-World Impact
o Real-world impact of function - executing code, updating databases, or sending notifications
• User Confirmation
o A step where the user confirms the action before it's executed
Tips for Better Performance
Problem: Large-scale NLP model output is non-deterministic (fuzzy)
• Use prompts to guide the model
o Use instructions and examples to make it clear to the model what kind of outputs you expect
• Prompting on application level
o i.e. prompts for scientific use, concepts, extra adjectives “polite” to steer the output
• Provide quality examples following pattern (CoTP)
o Esp. for code generation certain technical mistakes may be accepted as intentional
• Limit length, structure, order (recency bias) and rate of inputs and outputs
o Apply rate limits, number of messages to avoid unwanted behaviour
• Human responsibility for the output
Any sufficiently advanced technology is
indistinguishable from magic
~ Sir Arthur Clarke ~
How do GPT models work?
Surprising Findings
• Raw Training
o Training from large amount of unstructured text (can be automated) 300 bln words, 570GB text data
o 1 new token requires retraining of all weights
• Refinement
o Prompt and inspect for deviation in sense (reinforcement learning from human feedback)
• GPT is NN able to capture the complexity of human-generated language
o 175bln+ neuron connections with weights (GPT-3), 1tln+ parameters (GPT-4)
o GPT has no explicit knowledge of grammar rules
o Yet somehow “implicitly discovered” regularities in language (the hidden laws behind language).
• Grammatical rules
• Meaning and logic (semantics)
Finding: there’s actually a lot more structure and simplicity to meaningful human language than we ever knew
Embeddings as inner representation
• Reasonable continuation
o Generative model complete sentence by predicting next words
o Repeatedly apply the model (Predict the next token, and next, and next)
o Good prediction requires context of n-grams (words back)
• Highest ranked token - is that what it uses?
o No, because then all responses would be too similar.
o Actually, we have different results with the same prompt
• The Temperature Parameter
o How often lower ranked words will be used in the generation
o Temperature=0.8 empirically determined (no science here)
• Embeddings
o Numerical representation of a piece of information (text, doc, img)
o Group tokens in meaning spaces (by distance)
Embeddings Observations
• Statement
o Encoded to embedding (Vector representation)
• Distance in meaning
o Measured as cosine of angle b/w vectors
• Measure topical more than logical similarity
o “The sky is blue” is very close to “The sky is not blue”
• Punctuation affects embedding
o “THE. SKY. IS. BLUE!” is not that close to “The sky is blue”
• In-language is stronger than across-language
o “El cielo as azul” is closer to “El cielo es rojo” than to “The sky is blue”
Using the Embeddings
• Embedding Vectors (EVs)
o Smaller embeddings = efficient models
o GPT3 text-embedding-ada-002 has 1’536 dimensions and 99.8% performance of davinci-001 (12’288 length)
• Vector Distance
o EV distance correlates to semantic similarity of texts
• Attention is important
o Fully connected NN at such volume are overkill
o Continue the sentence in a reasonable way
• Prediction Stages
o Stage 1: Input of n tokens converted to EVs (i.e. 12’288 integers each)
o Stage 2: Get the sequence of positions of tokens into EV
o Stage 3: Combine EVs from Stage 1 and Stage 2 into EV
Context Encoding - Surprising Scientific Discovery
• Transformer NN Concept
o Proposed in 2017 by Google Brain team
o Feed Forward architecture (no recurrency, more efficient)
• Transformer Architecture Overview
o Input: encoder layer creates representation of the past as EV
o Attention blocks: generate contextual representation of the input
• Attention block has own pattern of attention
• Multiple attention heads process the EV in parallel
• Outputs concatenated and transformed (reweighted EV)
o Output: Classifier generates probability distribution for next token
• Attention block
o 96 blocks x 96 heads in GPT-3, 128 x 128 in GPT-4
o Image: 64x64 moving average of 1 attention block on EV
• The Magic: Shows neural net encoding of human language
.
LLMs are powerful though
consistently struggle with some
types of reasoning problems
(arithmetic and commonsense)
GPT Emerging Abilities
• LLM meant for Generation and Completion
o Not Math query solving specifically designed
o Sees numbers as tokens, no understanding of Math concepts
o Not reliable solving complex problems (Probabilistic approach)
Reasoning appears naturally is sufficiently large (10B+) LLM
Performance is near-random until a certain critical threshold is
reached, after which performance increases to substantially
• Emergent Abilities of Large Language Models (p.28)
• Chain of thought prompting elicits reasoning in LLM (p.8)
Emergence - quantitative changes in a system result in qualitative changes in behaviour
Chain of Thought Prompting (CoTP)
• What is CoTP
o Series of intermediate reasoning steps that guide the model
o Improves model abilities for complex reasoning
• LLMs are capable few-shot learners
• Translate, Classify, Summarize
• Few-shot manner to output CoTP
• How to do CoTP
o Ask similar question
o Show step-by-step
o Ask the real question
CoTP - Important Observations
• CoTP vs Standard Prompting improvement is robust
o Can potentially be applied to any task which humans use same technique
• Improvement achieved with very few samples (minimal data)
• Requires prompt engineering
o Background in ML is no required to prepare CoTP
o Order of examples matters (i.e. from 53% to 93%)
o Accuracy not improved by all CoTP authors
• Limitations
o 8 = the magical number
o Same CoTP affect models differently
• LaMDA, GPT-3, PaLM
o Gains not transferred across models
ChatGPT &
• As of 2023.03.23 ChatGPT
o Requires: ChatGPT-4 to use plugins
o Wolfram Alpha query behind the scenes
o Parse plugin response
• ChatGPT Plugins
o One of the most desired features
o Waiting list for new users
o Extend the potential use cases
o Provide access to information not included in training
• Recent
• Too personal
• Too specific
Tips for Developers
How can we get a closer match?
State of the art combination of all:
• Prompt Engineering
• In-Context Learning (CoTP)
o Inject information from internal/external knowledge base to provide context
o Similarity
o Code search
• Fine Tuning
o Not an option of GPT-4 yet and very expensive approach
• Plugins
• Functions
Features Working behind the Scenes
• Content Safety Moderator (preview May 2023)
( prompt: Tell me about content safety moderator in ChatGPT)
o Analyzes response for potential issues using rule-based systems and ML
o Designed to help detect and filter out content that may violate OpenAI's policies
o Enabled by default to OpenAI API
• Custom Content Filters
(prompt: what are custom content filters in ChatGPT)
o Allow users to add own content moderation rules on top of the default
o Rules can be used to filter out specific topics and ensure compliance.
o Additional layer of moderation to comply with standards
• Multi-modal Capabilities
o Separate Vision encoder
o Text and Vision encoders interact via cross-attention mechanism
Toggle low severity level filters (only)
Level 1: Prompt Use Cases (for Developers)
• Generate Code (Generate/Write/Create a function in [JS/C#/Java/Py] that does …)
• Code completion
• Bug detection (Find bug in this [Code])
• Code review
o Analyze the given [language] code for code smells and suggest improvements: [code snippet].
• API documentation generation
o Produce a tutorial for using the following [language] API with example code: [code snippet].
• Query optimization
o Suggest improvements to the following database schema for better query performance
o Suggest indexing or partitioning strategies for the following time-series database query: [time-series query].
• User interface design
o Generate a UI mockup for a [web/mobile] dashboard that visualizes [data or metrics]
Prompt Use Cases for Developers (continued…)
• Automated testing
o Write a test script for given [language] code that covers [functional or non-functional] testing: [code snippet].
• Code refactoring
o Optimize the following [language] code for lower memory usage: [code snippet]
• Algorithm development
o Design a heuristic algorithm to solve the following problem: [problem description].
• Code translation
o Rewrite the given [source language] data structure implementation in [target language]
• Technical writing
o Write a tutorial on how to integrate [library or service] with [programming language]
• Requirement analysis
o Analyze the given project requirements and propose a detailed project plan with milestones and deliverables
Level 2: Search is Better than Fine-Tuning
• Unfamiliar topics
o Recent events after September 2021
o Own non-public documents
o Past conversations
• GPT learns by:
o Model weights (fine tune model on training set)
o Model inputs (new knowledge, text)
• Parameters (Chat)
o temperature: controls the randomness of responses. >0.8 – creative; < 0.5 focused and deterministic.
o max_tokens: limits the length of the response to a specified number of tokens..
• Parameters (OpenAI API)
o top_p - balance creativity. Words with higher probability than top_p are included (i.e. 0.2 = deterministic)
o frequency_penalty - discourage the model from repeating same words
Sample Industrial Case: Zero-code User Analytics
1. User enters free text command to extract data from the data store
2. System generates query(SQL/InfluxQL) that filters and aggregates raw data (ETL)
o OpenAI shall use R/O user with limited access to Views/Measurements
3. System creates temporary data structure where telemetry data are loaded
o Data loaded in dedicated analytics DB using the query
o User option: Keep or apply retention policy to the data structures (cleanup)
o OpenAI filters applied to avoid error messages and make sure Update/Delete operations are denied
4. System generates command for inspection, as well as a preview of the data.
o The prompts will provide ability to prompt with example format
5. User enters free text command to process the data
6. System generates Python code for processing and analytics
o Statistical analysis, processing, train simple ML model
o Uses R/O user to the analytics DB
o User option: Loading data and analytics could be a one-time or continuous operations
DEMO
DEMO
OpenAI on YOUR data
With AZ Cognitive Search
Thanks to our Sponsors
1 of 36

Recommended

How do OpenAI GPT Models Work - Misconceptions and Tips for Developers by
How do OpenAI GPT Models Work - Misconceptions and Tips for DevelopersHow do OpenAI GPT Models Work - Misconceptions and Tips for Developers
How do OpenAI GPT Models Work - Misconceptions and Tips for DevelopersIvo Andreev
46 views36 slides
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j by
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jRobotics, Search and AI with Solr, MyRobotLab, and Deeplearning4j
Robotics, Search and AI with Solr, MyRobotLab, and Deeplearning4jKevin Watters
140 views40 slides
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L... by
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...
The Intersection of Robotics, Search and AI with Solr, MyRobotLab, and Deep L...Lucidworks
471 views40 slides
IBM Developer Model Asset eXchange - Deep Learning for Everyone by
IBM Developer Model Asset eXchange - Deep Learning for EveryoneIBM Developer Model Asset eXchange - Deep Learning for Everyone
IBM Developer Model Asset eXchange - Deep Learning for EveryoneNick Pentreath
125 views16 slides
Chatbots: Automated Conversational Model using Machine Learning by
Chatbots: Automated Conversational Model using Machine LearningChatbots: Automated Conversational Model using Machine Learning
Chatbots: Automated Conversational Model using Machine LearningAlgoAnalytics Financial Consultancy Pvt. Ltd.
373 views11 slides
Software Modeling and Artificial Intelligence: friends or foes? by
Software Modeling and Artificial Intelligence: friends or foes?Software Modeling and Artificial Intelligence: friends or foes?
Software Modeling and Artificial Intelligence: friends or foes?Jordi Cabot
2.2K views85 slides

More Related Content

Similar to OpenAI GPT in Depth - Questions and Misconceptions

"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft... by
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...Dataconomy Media
414 views30 slides
Implications of GPT-3 by
Implications of GPT-3Implications of GPT-3
Implications of GPT-3Raven Jiang
1.8K views21 slides
Improving your team’s source code searching capabilities by
Improving your team’s source code searching capabilitiesImproving your team’s source code searching capabilities
Improving your team’s source code searching capabilitiesNikos Katirtzis
510 views36 slides
Improving your team's source code searching capabilities - Voxxed Thessalonik... by
Improving your team's source code searching capabilities - Voxxed Thessalonik...Improving your team's source code searching capabilities - Voxxed Thessalonik...
Improving your team's source code searching capabilities - Voxxed Thessalonik...Nikos Katirtzis
52 views36 slides
Autonomous Machines with Project Bonsai by
Autonomous Machines with Project BonsaiAutonomous Machines with Project Bonsai
Autonomous Machines with Project BonsaiIvo Andreev
4.9K views29 slides
Prepare your data for machine learning by
Prepare your data for machine learningPrepare your data for machine learning
Prepare your data for machine learningIvo Andreev
9.1K views27 slides

Similar to OpenAI GPT in Depth - Questions and Misconceptions(20)

"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft... by Dataconomy Media
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
Dataconomy Media414 views
Implications of GPT-3 by Raven Jiang
Implications of GPT-3Implications of GPT-3
Implications of GPT-3
Raven Jiang1.8K views
Improving your team’s source code searching capabilities by Nikos Katirtzis
Improving your team’s source code searching capabilitiesImproving your team’s source code searching capabilities
Improving your team’s source code searching capabilities
Nikos Katirtzis510 views
Improving your team's source code searching capabilities - Voxxed Thessalonik... by Nikos Katirtzis
Improving your team's source code searching capabilities - Voxxed Thessalonik...Improving your team's source code searching capabilities - Voxxed Thessalonik...
Improving your team's source code searching capabilities - Voxxed Thessalonik...
Nikos Katirtzis52 views
Autonomous Machines with Project Bonsai by Ivo Andreev
Autonomous Machines with Project BonsaiAutonomous Machines with Project Bonsai
Autonomous Machines with Project Bonsai
Ivo Andreev4.9K views
Prepare your data for machine learning by Ivo Andreev
Prepare your data for machine learningPrepare your data for machine learning
Prepare your data for machine learning
Ivo Andreev9.1K views
OpenAI-SDK101.pptx by Ken Ross
OpenAI-SDK101.pptxOpenAI-SDK101.pptx
OpenAI-SDK101.pptx
Ken Ross22 views
DMDS Winter 2015 Workshop 1 slides by Paige Morgan
DMDS Winter 2015 Workshop 1 slidesDMDS Winter 2015 Workshop 1 slides
DMDS Winter 2015 Workshop 1 slides
Paige Morgan835 views
ChatGPT For Business Use by Sanjay Willie
ChatGPT For Business UseChatGPT For Business Use
ChatGPT For Business Use
Sanjay Willie152 views
2023-My AI Experience - Colm Dunphy.pdf by Colm Dunphy
2023-My AI Experience - Colm Dunphy.pdf2023-My AI Experience - Colm Dunphy.pdf
2023-My AI Experience - Colm Dunphy.pdf
Colm Dunphy24 views
Breaking Through The Challenges of Scalable Deep Learning for Video Analytics by Jason Anderson
Breaking Through The Challenges of Scalable Deep Learning for Video AnalyticsBreaking Through The Challenges of Scalable Deep Learning for Video Analytics
Breaking Through The Challenges of Scalable Deep Learning for Video Analytics
Jason Anderson389 views
Making PHP Smarter - Dutch PHP 2023.pptx by Adam Englander
Making PHP Smarter - Dutch PHP 2023.pptxMaking PHP Smarter - Dutch PHP 2023.pptx
Making PHP Smarter - Dutch PHP 2023.pptx
Adam Englander39 views
Global Azure Bootcamp - ML.NET for developers by Chris Melinn
Global Azure Bootcamp - ML.NET for developersGlobal Azure Bootcamp - ML.NET for developers
Global Azure Bootcamp - ML.NET for developers
Chris Melinn89 views
Open, Secure & Transparent AI Pipelines by Nick Pentreath
Open, Secure & Transparent AI PipelinesOpen, Secure & Transparent AI Pipelines
Open, Secure & Transparent AI Pipelines
Nick Pentreath277 views
Programming Languages #devcon2013 by Iván Montes
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013
Iván Montes1.2K views
The Power of Auto ML and How Does it Work by Ivo Andreev
The Power of Auto ML and How Does it WorkThe Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it Work
Ivo Andreev2.8K views

More from Ivo Andreev

Cutting Edge Computer Vision for Everyone by
Cutting Edge Computer Vision for EveryoneCutting Edge Computer Vision for Everyone
Cutting Edge Computer Vision for EveryoneIvo Andreev
17 views39 slides
Collecting and Analysing Spaceborn Data by
Collecting and Analysing Spaceborn DataCollecting and Analysing Spaceborn Data
Collecting and Analysing Spaceborn DataIvo Andreev
32 views42 slides
Collecting and Analysing Satellite Data with Azure Orbital by
Collecting and Analysing Satellite Data with Azure OrbitalCollecting and Analysing Satellite Data with Azure Orbital
Collecting and Analysing Satellite Data with Azure OrbitalIvo Andreev
93 views42 slides
CosmosDB for IoT Scenarios by
CosmosDB for IoT ScenariosCosmosDB for IoT Scenarios
CosmosDB for IoT ScenariosIvo Andreev
107 views13 slides
Forecasting time series powerful and simple by
Forecasting time series powerful and simpleForecasting time series powerful and simple
Forecasting time series powerful and simpleIvo Andreev
181 views32 slides
Constrained Optimization with Genetic Algorithms and Project Bonsai by
Constrained Optimization with Genetic Algorithms and Project BonsaiConstrained Optimization with Genetic Algorithms and Project Bonsai
Constrained Optimization with Genetic Algorithms and Project BonsaiIvo Andreev
232 views32 slides

More from Ivo Andreev(20)

Cutting Edge Computer Vision for Everyone by Ivo Andreev
Cutting Edge Computer Vision for EveryoneCutting Edge Computer Vision for Everyone
Cutting Edge Computer Vision for Everyone
Ivo Andreev17 views
Collecting and Analysing Spaceborn Data by Ivo Andreev
Collecting and Analysing Spaceborn DataCollecting and Analysing Spaceborn Data
Collecting and Analysing Spaceborn Data
Ivo Andreev32 views
Collecting and Analysing Satellite Data with Azure Orbital by Ivo Andreev
Collecting and Analysing Satellite Data with Azure OrbitalCollecting and Analysing Satellite Data with Azure Orbital
Collecting and Analysing Satellite Data with Azure Orbital
Ivo Andreev93 views
CosmosDB for IoT Scenarios by Ivo Andreev
CosmosDB for IoT ScenariosCosmosDB for IoT Scenarios
CosmosDB for IoT Scenarios
Ivo Andreev107 views
Forecasting time series powerful and simple by Ivo Andreev
Forecasting time series powerful and simpleForecasting time series powerful and simple
Forecasting time series powerful and simple
Ivo Andreev181 views
Constrained Optimization with Genetic Algorithms and Project Bonsai by Ivo Andreev
Constrained Optimization with Genetic Algorithms and Project BonsaiConstrained Optimization with Genetic Algorithms and Project Bonsai
Constrained Optimization with Genetic Algorithms and Project Bonsai
Ivo Andreev232 views
Azure security guidelines for developers by Ivo Andreev
Azure security guidelines for developers Azure security guidelines for developers
Azure security guidelines for developers
Ivo Andreev72 views
Global azure virtual 2021 - Azure Lighthouse by Ivo Andreev
Global azure virtual 2021 - Azure LighthouseGlobal azure virtual 2021 - Azure Lighthouse
Global azure virtual 2021 - Azure Lighthouse
Ivo Andreev2.6K views
Flux QL - Nexgen Management of Time Series Inspired by JS by Ivo Andreev
Flux QL - Nexgen Management of Time Series Inspired by JSFlux QL - Nexgen Management of Time Series Inspired by JS
Flux QL - Nexgen Management of Time Series Inspired by JS
Ivo Andreev2.5K views
Azure architecture design patterns - proven solutions to common challenges by Ivo Andreev
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
Ivo Andreev4.3K views
Industrial IoT on Azure by Ivo Andreev
Industrial IoT on AzureIndustrial IoT on Azure
Industrial IoT on Azure
Ivo Andreev7.1K views
Flying a Drone with JavaScript and Computer Vision by Ivo Andreev
Flying a Drone with JavaScript and Computer VisionFlying a Drone with JavaScript and Computer Vision
Flying a Drone with JavaScript and Computer Vision
Ivo Andreev1.3K views
ML with Power BI for Business and Pros by Ivo Andreev
ML with Power BI for Business and ProsML with Power BI for Business and Pros
ML with Power BI for Business and Pros
Ivo Andreev9.2K views
Industrial IoT with Azure and Open Source by Ivo Andreev
Industrial IoT with Azure and Open SourceIndustrial IoT with Azure and Open Source
Industrial IoT with Azure and Open Source
Ivo Andreev12.1K views
Machine Learning at Hand with Power BI by Ivo Andreev
Machine Learning at Hand with Power BIMachine Learning at Hand with Power BI
Machine Learning at Hand with Power BI
Ivo Andreev4.8K views
Python Development in VS2019 by Ivo Andreev
Python Development in VS2019Python Development in VS2019
Python Development in VS2019
Ivo Andreev3.2K views
The Data Science Process - Do we need it and how to apply? by Ivo Andreev
The Data Science Process - Do we need it and how to apply?The Data Science Process - Do we need it and how to apply?
The Data Science Process - Do we need it and how to apply?
Ivo Andreev6K views
Smart Web Apps with Azure and AI as a Service by Ivo Andreev
Smart Web Apps with Azure and AI as a ServiceSmart Web Apps with Azure and AI as a Service
Smart Web Apps with Azure and AI as a Service
Ivo Andreev15.3K views
Predictive Maintenance - Predict the Unpredictable by Ivo Andreev
Predictive Maintenance - Predict the UnpredictablePredictive Maintenance - Predict the Unpredictable
Predictive Maintenance - Predict the Unpredictable
Ivo Andreev3K views
The Machine Learning Workflow with Azure by Ivo Andreev
The Machine Learning Workflow with AzureThe Machine Learning Workflow with Azure
The Machine Learning Workflow with Azure
Ivo Andreev6.4K views

Recently uploaded

Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...NimaTorabi2
12 views17 slides
Generic or specific? Making sensible software design decisions by
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
6 views60 slides
Short_Story_PPT.pdf by
Short_Story_PPT.pdfShort_Story_PPT.pdf
Short_Story_PPT.pdfutkarshsatishkumarsh
5 views16 slides
HarshithAkkapelli_Presentation.pdf by
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdfharshithakkapelli
11 views16 slides
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Donato Onofri
860 views34 slides
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
8 views26 slides

Recently uploaded(20)

Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi212 views
Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri860 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j8 views
tecnologia18.docx by nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino5 views
Airline Booking Software by SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta6 views
predicting-m3-devopsconMunich-2023.pptx by Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app7 views
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action by Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok6 views
Bootstrapping vs Venture Capital.pptx by Zeljko Svedic
Bootstrapping vs Venture Capital.pptxBootstrapping vs Venture Capital.pptx
Bootstrapping vs Venture Capital.pptx
Zeljko Svedic12 views
360 graden fabriek by info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492122 views

OpenAI GPT in Depth - Questions and Misconceptions

  • 1. OpenAI GPT in Depth Misconceptions and questions you would like answered The event for those who want to unlock the industrial potential with AI
  • 2. We do not focus on this We focus on this Topics we will Safely Ignore • Convolutional Neural Networks (CNN) • Compare GPT-4 to 3.5 and Bard • Art of prompt engineering • Roles, perspective training • Having fun with ChatGPT • Plugins, generating content
  • 3. Thanks to our Sponsors
  • 4. • Solution Architect @ • Microsoft Azure & AI MVP • External Expert Eurostars-Eureka, Horizon Europe • External Expert InnoFund Denmark, RIF Cyprus • Business Interests o Web Development, SOA, Integration o IoT, Machine Learning o Security & Performance Optimization • Contact ivelin.andreev@kongsbergdigital.com www.linkedin.com/in/ivelin www.slideshare.net/ivoandreev SPEAKER BIO
  • 5. Upcoming Events DataSaturday Sofia, 2023 Oct 7, 2023 @Sofia Tech Park Tickets (Eventbrite) Submit Session (Sessionize) JS Talks Nov 17-18, 2023 @Sofia Tech Park Tickets (Eventbrite) Submit Session (Sessionize)
  • 6. Takeaways • What is ChatGPT doing and why does it work o https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/ • OpenAI Transparency Note, Limitations, Best Practices o https://learn.microsoft.com/en-us/legal/cognitive-services/openai/transparency-note • Sparks of General Intelligence in GPT-4 (Microsoft Research, Apr 2023) o https://youtu.be/Oxyg5I167b0 • Prompts for Developers o https://github.com/f/awesome-chatgpt-prompts o (Course) ChatGPT Prompt Engineering for Developers (by OpenAI) • OpenAI Cookbook(sample code for common tasks with the OpenAI API) o https://github.com/openai/openai-cookbook/ You MUST read that one And watch that one
  • 7. Key Terms TERM DEFINITION Prompt The text you send to the service in the API call. This text is then input into the model. Completion or Generation The text Azure OpenAI outputs in response. Token Unit of text that the model uses to process and understand language Text is processed by breaking it down into tokens. Tokens can be words or just chunks of characters. • 1 token ~= 4 chars in English • 100 tokens ~= 75 words Few-shot prompting One-shot prompting Zero-shot prompting Few examples show the model how to operate. Include several examples in the prompt that demonstrate the expected answer format and content. (additional training) Embedding Information dense representation of the semantic meaning of a piece of text. Format is vector of floating point numbers Recency Bias The order input is presented matters
  • 8. Know your GPT • ChatGPT for Enterprises (URL) o Launched 2023.08.23 • Pricing o Negotiate case-by-case • Highlights • Copyright Lawsuits o Under attack by copyright holders o Does CoPilot training on GitHub violate open-source licenses? • Microsoft Promise (URL) o Microsoft would cover the cost for any copyright violations that may arise from use (applies to M365 Copilot, Copilot and Bing Chat Enterprise)
  • 9. Good to Know! • All prompts result in completions o Model completes the text o Model replies with what it thinks is most likely to follow • Large-scale language and image models can potentially behave in ways that are unfair, unreliable, or offensive, in turn causing harms • OpenAI models are trained primarily in English. o Bias may have been introduced. Other languages are likely to have worse performance. • Stereotyping o DALL-E generation of homeless and fatherless may render images of predominantly Afro-Americans • Information reliability o Fabricate seemingly reasonable content that does not correspond to facts. o Even training on trusted sources may fabricate content that misrepresent the sources
  • 11. Top Questions (and Answers) Q: Why does the same problem receive different answers for different users and under what conditions shall we expect improvement to result in taking to the best answer and who decides on which is the best answer • A: Models are designed to inject varying amounts of pseudo randomness into the response tokens that are provided based on your parameters. This is particularly influenced by the temperature parameter. o Temperature [0,1] - Controls the “creativity” or randomness of the text generated. A higher value will make the output more divergent (fictional) o Prompt: Give me a creative response. (temperature=1.0) Q: Is there a way to improve explainability - mainly the source at which the response is based (i.e. in Bing chat) • A: For GPT-4 by itself, chain-of-thought prompting is a technique that can help increase the likelihood of accurate answers, but it is not going to give you accurate source citations. o …cite the reason behind the classification, using the format BEHAVIOR("reason") o …Output format: {"TOPIC_NAME": "", "HEADLINES": [], "REASONING": ""} o Answer in 100 words or less. Use bullet lists wherever possible. Q: Why does Bing chat work differently? • This is NOT Bing presenting its sources • Chunks of text from Bing search sources added behind the scenes to the GPT-4 Chat Completion call as part of the messages array. GPT-4 is not guaranteed to limit to present these sources
  • 12. Manage the Conversation Efficiently • Think in Tokens o Common multisyllable words are a single token (i.e. dataset) o Less common words or dates are broken into tokens (i.e. tuning, 2023/10/18) o Tokenizer app: https://tokenization.azurewebsites.net/ • Context o No memory, all information shall be present in the conversation o Once the token count is reached the oldest messages iwill be removed (Quality degrades ) o Context = prompts + input + output • Each model training increases the limit but such still exists o GPT-3.5 (4’096 tokens), GPT-4 (8’192 tokens, 10 pages), GPT-4-32 (32’768 tokens, 40 pages) o Option: limit the conversation duration to the max token length or a certain number of turns o Option: summarize conversation until now and feed the summary as a prompt (details are lost)
  • 13. Own data in GPT with AZ Search • Own data for responses in ChatGPT (preview 2023.06.19) o https://github.com/pablomarin/GPT-Azure-Search-Engine/blob/main/03-Quering-AOpenAI.ipynb o https://github.com/Azure-Samples/azure-search-openai-demo/ o Inject own data using prompts (NO fine tuning and retraining) • The Challenges o Context limit is 4K (v3.5), 32K(v.4) tokens in a prompt o Passing GBs of data as prompt is not possible • Approach o Keep all the data in an external knowledge base (KB) o Retrieve fast from the KB (AZ Cognitive Search) • Flow o Determines what data to retrieve from data source (Cognitive Search) based on the user input o Data augmented and appended to the prompt to the OpenAI model o Resulting input processed like any other prompt by the model
  • 14. Function Calling • Available in Azure OpenAI (2023.07.20) o gpt-35-turbo and gpt-4 can produce structured JSON outputs based on functions o new API parameters in our /v1/chat/completions endpoint (functions, function_call) Note: Completions API does not call the function; instead, the model generates JSON that you can use • Purpose o Solves inability of models to address online data o Empowers developers to easily integrate external tools and APIs o Model recognizes situations where function call is necessary and creates structured JSON output • Retrieve from data sources (search indexes, databases, APIs) • Actions (write data to a database, call integration APIs, send notifications)
  • 15. Function Calling Tips • Default Auto o When functions are provided, by default the function_call will be set to "auto" • Validate function calls o verify the function calls generated by the model. – parameters, intended action • Data from Trusted/Verified Sources o Untrusted data in a function output could instruct model to write function calls in a not intended way • Least Privilege Principle o The minimum access necessary for the function to perform its job o I.e. query a database – use R/O access to the database • Consider Real-World Impact o Real-world impact of function - executing code, updating databases, or sending notifications • User Confirmation o A step where the user confirms the action before it's executed
  • 16. Tips for Better Performance Problem: Large-scale NLP model output is non-deterministic (fuzzy) • Use prompts to guide the model o Use instructions and examples to make it clear to the model what kind of outputs you expect • Prompting on application level o i.e. prompts for scientific use, concepts, extra adjectives “polite” to steer the output • Provide quality examples following pattern (CoTP) o Esp. for code generation certain technical mistakes may be accepted as intentional • Limit length, structure, order (recency bias) and rate of inputs and outputs o Apply rate limits, number of messages to avoid unwanted behaviour • Human responsibility for the output
  • 17. Any sufficiently advanced technology is indistinguishable from magic ~ Sir Arthur Clarke ~ How do GPT models work?
  • 18. Surprising Findings • Raw Training o Training from large amount of unstructured text (can be automated) 300 bln words, 570GB text data o 1 new token requires retraining of all weights • Refinement o Prompt and inspect for deviation in sense (reinforcement learning from human feedback) • GPT is NN able to capture the complexity of human-generated language o 175bln+ neuron connections with weights (GPT-3), 1tln+ parameters (GPT-4) o GPT has no explicit knowledge of grammar rules o Yet somehow “implicitly discovered” regularities in language (the hidden laws behind language). • Grammatical rules • Meaning and logic (semantics) Finding: there’s actually a lot more structure and simplicity to meaningful human language than we ever knew
  • 19. Embeddings as inner representation • Reasonable continuation o Generative model complete sentence by predicting next words o Repeatedly apply the model (Predict the next token, and next, and next) o Good prediction requires context of n-grams (words back) • Highest ranked token - is that what it uses? o No, because then all responses would be too similar. o Actually, we have different results with the same prompt • The Temperature Parameter o How often lower ranked words will be used in the generation o Temperature=0.8 empirically determined (no science here) • Embeddings o Numerical representation of a piece of information (text, doc, img) o Group tokens in meaning spaces (by distance)
  • 20. Embeddings Observations • Statement o Encoded to embedding (Vector representation) • Distance in meaning o Measured as cosine of angle b/w vectors • Measure topical more than logical similarity o “The sky is blue” is very close to “The sky is not blue” • Punctuation affects embedding o “THE. SKY. IS. BLUE!” is not that close to “The sky is blue” • In-language is stronger than across-language o “El cielo as azul” is closer to “El cielo es rojo” than to “The sky is blue”
  • 21. Using the Embeddings • Embedding Vectors (EVs) o Smaller embeddings = efficient models o GPT3 text-embedding-ada-002 has 1’536 dimensions and 99.8% performance of davinci-001 (12’288 length) • Vector Distance o EV distance correlates to semantic similarity of texts • Attention is important o Fully connected NN at such volume are overkill o Continue the sentence in a reasonable way • Prediction Stages o Stage 1: Input of n tokens converted to EVs (i.e. 12’288 integers each) o Stage 2: Get the sequence of positions of tokens into EV o Stage 3: Combine EVs from Stage 1 and Stage 2 into EV
  • 22. Context Encoding - Surprising Scientific Discovery • Transformer NN Concept o Proposed in 2017 by Google Brain team o Feed Forward architecture (no recurrency, more efficient) • Transformer Architecture Overview o Input: encoder layer creates representation of the past as EV o Attention blocks: generate contextual representation of the input • Attention block has own pattern of attention • Multiple attention heads process the EV in parallel • Outputs concatenated and transformed (reweighted EV) o Output: Classifier generates probability distribution for next token • Attention block o 96 blocks x 96 heads in GPT-3, 128 x 128 in GPT-4 o Image: 64x64 moving average of 1 attention block on EV • The Magic: Shows neural net encoding of human language .
  • 23. LLMs are powerful though consistently struggle with some types of reasoning problems (arithmetic and commonsense)
  • 24. GPT Emerging Abilities • LLM meant for Generation and Completion o Not Math query solving specifically designed o Sees numbers as tokens, no understanding of Math concepts o Not reliable solving complex problems (Probabilistic approach) Reasoning appears naturally is sufficiently large (10B+) LLM Performance is near-random until a certain critical threshold is reached, after which performance increases to substantially • Emergent Abilities of Large Language Models (p.28) • Chain of thought prompting elicits reasoning in LLM (p.8) Emergence - quantitative changes in a system result in qualitative changes in behaviour
  • 25. Chain of Thought Prompting (CoTP) • What is CoTP o Series of intermediate reasoning steps that guide the model o Improves model abilities for complex reasoning • LLMs are capable few-shot learners • Translate, Classify, Summarize • Few-shot manner to output CoTP • How to do CoTP o Ask similar question o Show step-by-step o Ask the real question
  • 26. CoTP - Important Observations • CoTP vs Standard Prompting improvement is robust o Can potentially be applied to any task which humans use same technique • Improvement achieved with very few samples (minimal data) • Requires prompt engineering o Background in ML is no required to prepare CoTP o Order of examples matters (i.e. from 53% to 93%) o Accuracy not improved by all CoTP authors • Limitations o 8 = the magical number o Same CoTP affect models differently • LaMDA, GPT-3, PaLM o Gains not transferred across models
  • 27. ChatGPT & • As of 2023.03.23 ChatGPT o Requires: ChatGPT-4 to use plugins o Wolfram Alpha query behind the scenes o Parse plugin response • ChatGPT Plugins o One of the most desired features o Waiting list for new users o Extend the potential use cases o Provide access to information not included in training • Recent • Too personal • Too specific
  • 29. How can we get a closer match? State of the art combination of all: • Prompt Engineering • In-Context Learning (CoTP) o Inject information from internal/external knowledge base to provide context o Similarity o Code search • Fine Tuning o Not an option of GPT-4 yet and very expensive approach • Plugins • Functions
  • 30. Features Working behind the Scenes • Content Safety Moderator (preview May 2023) ( prompt: Tell me about content safety moderator in ChatGPT) o Analyzes response for potential issues using rule-based systems and ML o Designed to help detect and filter out content that may violate OpenAI's policies o Enabled by default to OpenAI API • Custom Content Filters (prompt: what are custom content filters in ChatGPT) o Allow users to add own content moderation rules on top of the default o Rules can be used to filter out specific topics and ensure compliance. o Additional layer of moderation to comply with standards • Multi-modal Capabilities o Separate Vision encoder o Text and Vision encoders interact via cross-attention mechanism Toggle low severity level filters (only)
  • 31. Level 1: Prompt Use Cases (for Developers) • Generate Code (Generate/Write/Create a function in [JS/C#/Java/Py] that does …) • Code completion • Bug detection (Find bug in this [Code]) • Code review o Analyze the given [language] code for code smells and suggest improvements: [code snippet]. • API documentation generation o Produce a tutorial for using the following [language] API with example code: [code snippet]. • Query optimization o Suggest improvements to the following database schema for better query performance o Suggest indexing or partitioning strategies for the following time-series database query: [time-series query]. • User interface design o Generate a UI mockup for a [web/mobile] dashboard that visualizes [data or metrics]
  • 32. Prompt Use Cases for Developers (continued…) • Automated testing o Write a test script for given [language] code that covers [functional or non-functional] testing: [code snippet]. • Code refactoring o Optimize the following [language] code for lower memory usage: [code snippet] • Algorithm development o Design a heuristic algorithm to solve the following problem: [problem description]. • Code translation o Rewrite the given [source language] data structure implementation in [target language] • Technical writing o Write a tutorial on how to integrate [library or service] with [programming language] • Requirement analysis o Analyze the given project requirements and propose a detailed project plan with milestones and deliverables
  • 33. Level 2: Search is Better than Fine-Tuning • Unfamiliar topics o Recent events after September 2021 o Own non-public documents o Past conversations • GPT learns by: o Model weights (fine tune model on training set) o Model inputs (new knowledge, text) • Parameters (Chat) o temperature: controls the randomness of responses. >0.8 – creative; < 0.5 focused and deterministic. o max_tokens: limits the length of the response to a specified number of tokens.. • Parameters (OpenAI API) o top_p - balance creativity. Words with higher probability than top_p are included (i.e. 0.2 = deterministic) o frequency_penalty - discourage the model from repeating same words
  • 34. Sample Industrial Case: Zero-code User Analytics 1. User enters free text command to extract data from the data store 2. System generates query(SQL/InfluxQL) that filters and aggregates raw data (ETL) o OpenAI shall use R/O user with limited access to Views/Measurements 3. System creates temporary data structure where telemetry data are loaded o Data loaded in dedicated analytics DB using the query o User option: Keep or apply retention policy to the data structures (cleanup) o OpenAI filters applied to avoid error messages and make sure Update/Delete operations are denied 4. System generates command for inspection, as well as a preview of the data. o The prompts will provide ability to prompt with example format 5. User enters free text command to process the data 6. System generates Python code for processing and analytics o Statistical analysis, processing, train simple ML model o Uses R/O user to the analytics DB o User option: Loading data and analytics could be a one-time or continuous operations
  • 35. DEMO DEMO OpenAI on YOUR data With AZ Cognitive Search
  • 36. Thanks to our Sponsors