01-08-2023
How to create intelligent solutions with Generative AI?
by José Camacho, Senior .NET Developer & DevOps Team Lead @ Xpand IT
Undoubtedly, artificial intelligence (AI) is the technological trend of 2023. Thanks to the now famous ChatGPT, which has so much knowledge, its great boom in recent months has been so accelerated that the services and possibilities behind AI are already a reliable source.
In the last months, the digital transformation areas at Xpand IT have been working with AI. Azure OpenAI Services is the current option to create customer-facing apps, improve employee empowerment or create backend business-driven solutions for customers in banking, insurance, renewable energy, retail, etc.
However, what is behind Artificial Intelligence? What do OpenAI services provide to prepare a system or model capable of personalized assistance? Come along and keep reading this blog post.
OpenAI Models
There are several artificial intelligence models that are frequently used in software engineering and development:
- Generative AI: models that can generate text, images and/or videos
- Large Language Model (LLM): the large quantity models that rely on many hours of training and investment in GPUs
- Generative pre-trained transformers: the disruptive technology that powers AI models like GPT, a language model architecture based on neural networks and trained on text from multiple internet sources capable of generating coherent and fluent text
If you want to work with AI models, check out the following key concepts
The execution of AI models is based on the following concepts/actions:
- Prompt: text excerpt with some context that tells the model what we want
- Completion: the output, that is: what GPT generates based on what was requested
- Token: part or all of the words processed by the GPT models
- Prompt Engineering: the process of building and validating prompts based on phrases or requests, giving the model context to behave in a certain way
Engineering prompt examples with instructions, examples/context, input and output:
Examples of models with zero, one or few shots — examples that allow giving better knowledge to the model to reach the expected result of an order:
What you also need to know about Large Language Models (LLM)
As you may have already seen on ChatGPT, many people ask the same question. However, the answer to that question may differ for each user because the basis of LLMs is probabilistic — this is where we can start talking about the limits of artificial intelligence’s effectiveness.
The probabilistic basis can generate:
- Hallucination: outputs that are not supported by the input or are factually incorrect
- Inappropriate outputs: these may contain offensive or sensitive content that is difficult to monitor or correct behaviour
- Outdated or irrelevant data as new information emerges. Training these models requires a lot of computation, time and constant optimization
- Limit on number of tokens: inability to input large documents to give a prompt full context
Some Large Language Models use cases:
- Generation: generate text from a short prompt (what ChatGPT does)
- Summarization: summarize a large text/prompt (e.g. from a book)
- Rewrite: the ability to rewrite text via a source text prompt
- Extraction: extract specific text from a prompt source text
- Classification: classify text from a sample text prompt
- Search: semantic search
- Clustering: grouping information
How to use Artificial Intelligence in the Cloud? Azure OpenAI Services
Azure OpenAI Services is a Microsoft cloud service created for companies that allows you to develop customized solutions based on existing OpenAI models on the market:
- GPT3, GPT4 and ChatGPT: a template that generates text for various uses and applications
- Codex: model specialized in code, ability to generate code, is behind GitHub Copilot (extension for Visual Studio Code)
- DALL-E 2: generate images based on text that, for example, is available on Microsoft’s Bing
Find out more about how we use Azure OpenAI Services and its models with three distinct use cases: semantic search, questions and answers with semantic search from a document, and in support/assistance for customers — with a demonstration of the architecture/prompt engineering of each.
Leave a comment
Comments are closed.