Generative AI for Software Development
Generative AI for Software Development
In this doc we will talk about Generative AI and how it can be used in software development. This is not about how to build a generative AI model, but how to use existing generative AI models to help with software development.
This is a note for the course Generative AI for Software Development on Coursera.
Concept
1. What is Generative AI?
Generative AI is a type of AI that can generate new data that looks like it came from the original dataset. It can be used to generate new images, text, music, etc. Generative AI models are trained on a dataset and learn the patterns in the data to generate new data that looks similar to the original data.
With generative AI, AI can now aid in content creation that goes beyond traditional processing of data. It can generate new data that looks like it came from the original dataset, which can be used in various applications. eg, the image generation tool DALL-E from OpenAI. It’s a typical example of generating content from descriptions.
2. What is AI?
AI stands for Artificial Intelligence, which is programming computers to react to data in a similar way to a thinking being.
Human / cats / other beings: recognize “features” -> make decisions based on those features
Computers: recognize “features” -> make decisions based on those features
For traditional programming, the input are “rules” and “data” that are fed into the computer, and the computer will output the “answers” based on the “rules” and “data”. For machine learning, the input are “data” and “answers” that are fed into the computer, and the computer will output the “rules”.
The paradigm of machine learning:
- Make a guess
- Measure how good the guess is
- Adjust the guess to make it better
- Repeat
The
Answersare typically calledLabelsorTargets.
3. What is a Model
From what’s mentioned above, a Model is the output of the machine learning process, which can automatically give answers from the input data, based on the rules learned from the training data.
4. Supervised Machine Learning
Supervised Machine Learning is a type of machine learning where the model is trained on a labeled dataset. The model learns the patterns in the data and uses these patterns to make predictions on new data.Supervised Machine Learning is backbone of systems that require reilable and accurate predictions based on historical data.
Besides this, there are also the following types of machine learning:
Generative AIUnsupervised LearningReinforcement Learning
5. LLM (Large Language Model)
LLMs are built by using superivsed learning (A->B) to repeatedly predict the next word.
A table explaining the process of giving My favorite desert is to My favorite desert is chocolate ice cream:
| Input (A) | Output (B) |
|---|---|
| My favorite desert is | chocolate |
| My favorite desert is chocolate | ice |
| My favorite desert is chocolate ice | cream |
6. Transformer
“Attention Is All You Need” is the paper that introduced the
Transformermodel.
The Transformer model brings a new approach to machine learning models for handling sequences of information like text.Supervised Learning: computer learns to predict data that was labled and a machine learns to match the data to the labels.Recurrent Neural Networks (RNNs): more complex, started to learn the sequence of data. Useful for models that could predict the next word in a sentence as opposed to “what they see”. But it cannot understand the deep meaning of the data.Transformer: Process all part of the data simultaneously. This not only speeds up the training, but also improves the ability to handle long range dependencies in the data.
Two key concepts of the Transformer model: Attention and Encoders and Decoders.
6.1 Attention
Allows the model to focus on specific words when predicing the next word.
… (to be continued)
6.2 Encoders and Decoders
Components of the model architecture that prepare and process text.
… (to be continued)