Generative AI Course for SAP Users
Generative AI Course for SAP Users
How it works:
▪ Course consists of 5 units
▪ Course assignment
▪ Discussion forum
Max Tegmark, Life 3.0: Being Human in the Age of Artificial Intelligence
Symbolic AI: explicitly represent knowledge e.g. through rules, expert systems, and deterministic
programming
false
Condition
true
Code 1 Code 2
Thought experiment: how many rules would you need to describe something as simple as
identifying a picture of a cat vs. a picture of a dog in a computer?
Training = “cat”
Data
false
Condition (examples) = “dog”
Training
true
= 𝜃𝑗
Machine 1
𝑚
Observation (state)
Self-supervised learning
▪ Neural networks where the “label examples” are given in the structure
of the data itself, e.g. large language models predict the next word
▪ Basis of foundation models and generative AI. We will explore more in Unit 2.
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9
Approaches to artificial intelligence
A note on statistical approaches to AI, probability, and uncertainty
Deep Learning
▪ A subfield of machine learning that uses specialized computational techniques, namely various multi-
layer artificial neural network architectures (e.g. RNNs, CNNs, transformers…)
open@sap.com
Follow all of SAP
www.sap.com/contactsap
Large England
London is in _______
Large language models (LLMs)
Language
are a subcategory of foundation Two hours south of Toronto, London is
Models (LLMs)
models for text incl. computer code. Ontario
in _______
Example
Capabilities
Characteristics
Data ▪ Huge models, often measured in billions of
Classification,
parameters and trained on billions/trillions of tokens
entity extraction
▪ Stateless: respond only to data sent to the model,
Text but do not “remember” or “learn” from previous
interactions
Summarization
▪ Performance and capabilities, in general, scale as
Image models increase in size
175 1,000
800
Attention-based transformer
600
as neural network
architecture (2017)
400
200
1.6
0.1
0
GPT (2018) GPT-2 XL GPT-3 (2020) Mistral Llama Falcon Llama GPT-3 BLOOM Lum- PaLM Mega- GPT-
(2019) 7B 2 13B 40B 2 70B inous tron 4?
Foundation models scale with more compute, more data, and more parameters (model size)
→ Higher accuracy, adaptability, and generative performance.
But also a trend towards smaller models benchmarking on certain tasks as well as much larger models due
to better training data and methods.
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7
Introduction to generative AI
Examples of generative AI
Output:
Large Language Models: create text. Large Language Models: summarize text.
Write an email introducing our logistics Summarize key benefits from the following
company, Treasure Island Transports Ltd, to 1000-word document in less than 100
a retail prospect. Do it the style of a pirate. Prompt words. Use bullet points.
Prompt
Large Language Models: classify and extract text. Write working code based on a text description
Positive sentiment
The object being referred to in the sentence is “your course
on openSAP”.
Prompt
Code
open@sap.com
Follow all of SAP
www.sap.com/contactsap
Such successes may give the impression that generative AI can tackle any problem out of the box.
Users must be aware of current limitations, keep expectations in check, and understand how to make
generative AI enterprise-ready to handle business problems.
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3
Adapting generative AI to business context
Example limitations of generative AI
Hallucination. Large language models can generate plausible-sounding yet false answers.
Related: LLMs can provide different “facts” depending on the language in which the prompt was given.
Up-to-date and specific knowledge. The knowledge of a generative AI model is frozen in time from when it
was trained. In contrast to world general knowledge, business information changes quickly.
Who won the NBA preseason game last What libraries and SDKs are available
night between the LA Lakers and Golden with SAP AI Core?
Prompt State Warriors? Prompt
As of my training data until September
I’m sorry for any inconvenience, but as an 2021, SAP AI Core does not provide any
AI last trained on data up to September specific libraries or SDKs. Instead, it Output
2021, I don’t have the ability to access Output integrates with various Python libraries
real-time information or updates, (model 1) and ML frameworks used for machine
including recent sports scores. learning and data science, such as
TensorFlow, PyTorch, Scikit-Learn, etc.
The Golden State Warriors defeated the Ground truth:
Los Angeles Lakers 114-101 in their SAP AI Core, launched October 12th 2021,
preseason game last night. Output provides SAP AI Core SDK, AP API Client
(model 2 – SDK, and Metaflow Python Library (SAP AI
hallucination) Core Product Documentation, 2023-09-01)
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5
Adapting generative AI to business context
Example limitations of generative AI
Inconsistent math abilities and limited notion of time. Although improving, large language models are not
calculators. Other kinds of foundation models could conceivably complete forecasts and math.
… even though the capabilities of generative AI to solve and explain some math problems are impressive!
Techniques like calling functions and chain-of-thought prompting can increase performance on math problems.
Solve for X, show your work, and list the This is a quadratic equation, and we can solve
answer: it by using the quadratic formula which is
Prompt x = [-b ± sqrt(b^2 - 4ac)] / (2a).
X^2 + 3x -5 = 0 Output
Here, a = 1, b = 3, and c = -5. (GPT-4)
Let’s plug these values into the formula:
x = [-3 ± sqrt((3)^2 - 4*1*(-5))] / (2*1)
Note: x = [-3 ± sqrt(9 + 20)] / 2
Checking the x = [-3 ± sqrt(29)] / 2
output, the LLM got
So, the solutions are:
the correct answer!
x = (-3 + sqrt(29)) / 2
x = (-3 - sqrt(29)) / 2
Prompting: Give the model detailed information to reliably produce the desired output.
Configure business
process by opening…
Embeddings: numerical representations of information that retain
semantic, contextual meaning (text, images, etc.)
LLM
Example: embed
The vector captures the semantic meaning in the text, e.g. “Apple”
has a different vector in “Apple makes phones” vs. “I have an
Apple iPhone 15” vs. “Apple is an ingredient in pies”.
Embeddings
Orchestration example (experimental): Give an LLM access to tools. An agent retrieves API specifications from SAP
systems, develops plan, and extracts data via API calls to formulate a response.
Example
LLM 1. Retrieve
SAP systems and their API specifications are retrieved
Autonomous Agent
based on the input (powered by knowledge graphs)
2. Plan
Task or
Answer The LLM generates a plan based on the API retrieved
question
specifications
Tools
3. Execute
The LLM follows the plan and generates API calls and
Autonomous agent reacts to the system responses
Fine-tuning: adjusting an existing foundation model’s parameters (i.e. weights) to perform better at a
specific task by retraining it on a new data set.
Data
Text
New Data
Improved
Curated
INITIAL domain- and/or
performance on
Image
TRAINING task-specific domain- and task-
data. Labeled specific problems
Pretrained with examples Fine-Tuned
Speech Foundation Model of desired input Foundation
and output Model
…
Fine-tuning process
Opportunities Challenges
▪ Strong potential to create task-specific models with ▪ May reduce but will not eliminate problems like
significant boost in accuracy. hallucination.
▪ Continued training on domain- or industry-specific data ▪ May not “forget” existing biases and information.
improves quality for downstream tasks in an area.
▪ Does not reliably learn new factual information.
▪ Smaller to medium-sized (~5-70 billion parameter)
▪ Requires sufficient (curated) training data.
LLMs can reach or exceed performance of more costly
massive models. ▪ Can be computationally expensive and costly.
▪ Currently difficult to generalize the volume of
training data needed to achieve meaningful results.
Consider and test task-specific instructions (prompt engineering) first before investing in fine-tuning models.
DO NOT DO
Trust generic generative AI ✓ Be aware of limitations. Ground
models to answer factual and adapt generative AI models on
questions correctly, esp. in business data to ensure output is
a business context. relevant and reliable.
open@sap.com
Follow all of SAP
www.sap.com/contactsap
Finance | Supply Chain | HR | Procurement | Marketing and Commerce | Sales and Services | IT
AI Foundation
on Business Technology Platform
AI Services
Foundation Models
Lifecycle Management
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4
Extending SAP applications with generative AI
AI Foundation
AI Foundation
on Business Technology Platform
AI Services
Document Processing Recommendation Machine Translation
Vector Engine
Data Management
Foundation Models
Lifecycle Management
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5
Extending SAP applications with generative AI
Generative AI Hub
Generative AI Hub
• Embeddings
Vector Engine Application data
• Similarity functions
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC * coming soon 7
Extending SAP applications with generative AI
Generative AI Hub: Toolset
Playground
Generative AI Hub
SAP built*
Client
API Custom
Partner built
Libraries & SDK
*planned
Custom
AVAILABLE UPCOMING
• Microsoft Azure • Aleph Alpha
Partner built OpenAI • Meta Llama2
• Falcon • and more…
*planned
Generative AI Hub
*planned
SAP built**
… SAP Identity & SAP HANA
Authentication Cloud
open@sap.com
Follow all of SAP
www.sap.com/contactsap
AI is already a central, integrated capability of our enterprise applications and business technology,
used by tens of thousands of our cloud customers.
BASE NEW
▪ Schema-based extraction
▪ Language coverage
▪ Extensions of SAP standard schemas
▪ Immediate improvement
© 2023 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5
Generative AI business use cases
Use case examples
Faster insights
Fast natural language querying with all the value
of business semantics
Trusted retrieval
Proprietary large language models (LLMs) to help ensure
secure information retrieval preserving data policies
Business agility
Multi-cloud workflow compatibility and integration
with external data sources
Joule
Note: Planned availability in SAP business applications at different times, starting with SAP SuccessFactors solutions and SAP Start in Q4 2023.
Generative AI Summarization
Writing
Assistant
Question
Answering
Code
Generation
SAP S/4HANA
Intelligent collections ●
SAP S/4HANA
Sales order auto-completion ● SAP Extended Warehouse Management
● Slotting recommendation
SAP Intelligent Product Recommendation
Configurable product quotation ● Finance
SAP Predictive Replenishment
● Replenishment optimization
Digital assistant for SAP CX
Intelligent questions and answers ▲ SAP Transportation Management
Sales and
Customer 360 profile summary and Supply chain ▲ Goods receipt processing
service
scheduling assistant ▲
open@sap.com
Follow all of SAP
www.sap.com/contactsap









