Introduction to Generative AI - Google Cloud Tech

olxtar·2024년 6월 13일
post-thumbnail

🎈 Comment

생성형 AI에 대해서 스터디하기 위해 (정론으로 생각되는?) 담백한 Google의 유튜브 영상을 정리해보자
[Youtube] Introduction to Generative AI - Google Cloud Tech




Introduction to Generative AI

Generative AI is a type of artificial intelligence technology that can produce various types of content, including text, image, audio, and synthetic data.
[+] synthetic : 합성의, 인조의, 종합적인 이미 알고 있는 판단을 근거로 새로운 판단을 유도하는 추론인 연역적 추론과 함께, 있다라는 어원에서 생성됨

생성형 AI에 대한 설명에 들어가기전에, Artificial Intelligence에 대하여 정리해보자.


01. Machine Learning

Artificial Intelligence : AI is the theory and development of computer systems able to perform tasks normally requiring human intelligence.

Machine Learning : ML gives computers the ability to learn without explicit programming.

One way to think about it is that Artificial Intelligence is a discipline, like physics for example.
[+] discipline : (규칙에 따라 행동하는) 훈련, 규율, 징벌, 학문의 분야

Machine Learning is a subfield of AI. It is a program or system that trains a model from input data. That trained model can make useful predictions from new or never before seen data drawn from the same one used to train the model.
머신러닝은 'AI'의 하위 분야
입력된 데이터로부터 모델을 훈련시키는 프로그램 or 시스템을 일컫음
머신러닝을 통해 훈련된 모델은, 새로운 데이터, 본적이 없는 데이터를 예측(입력된 데이터와 유사?같기는 해야함)


01-1. Supervised / Unsupervised

Two of the most common classes of machine learning models are unsupervised(비지도) and supervised(지도) ML models. The key difference between the two is that, with supervised models, we have labels. Labeled data is data that comes with a tag like a name, a type, or a number.
머신러닝 모델은 크게 비지도 / 지도 머신러닝 모델로 분류됨
지도, 비지도 머신러닝 모델의 중요 차이점은 바로 'label'
아래 예시를 보면서 이해해보자


🔰 Supervised Learning Case

\uparrow This graph is an example of the problem that a supervised model might try to solve. For example, let's say you are the owner of a restaurant. You have historical data of the bill amount and how much different people tipped based on order type, whether it was picked up or delivered.
In supervised learning, the model learns from past examples to predict future values, and in this case, tips. Here the Model uses the total bill amount to predict the future tip amount based on whether an order was picked up or delivered.
위 그래프는 Supervised 모델이 주로 해결하고자 하는 문제 중 하나이다
식당의 주인이 과거 고객들의 총 결제금액과 팁을 알고있다고 해보자, 지도학습을 통해서 과거의 총 결제금액 + 팁 데이터로 미래 고객의 결제금액에 따른 팁을 예측할 수 있다.



🔰 Unsupervised Learning Case

\uparrow This is an example of the sort of problem an unsupervised model might try to solve. Here you want to look at tenure and income and then group or cluster employees to see whether someone is on the fast track. Unsupervised problems are all about discovery about looking at the raw data and seeing if it naturally falls into groups.
[+] tenure : (부동산, 지위, 직분의) 보유(기간), 재임기간
위 그림은 Unsupervised 모델이 주로 해결하고자 하는 문제 중 하나이다
재직기간과 수입을 살펴본다음, 누가 잘나가고있는지 직원들을 그룹, 군집화 한다
Unsupervised Learning은 데이터를 보고 자연스럽게 그룹으로 분류되는지 발견하는 것이다



Let's get a little deeper and show this graphically as understanding these concepts are the foundation for your understanding of generative AI.
(ML에서의 지도/비지도학습에 대한 이해가) Generative AI를 이해하는데 기반이 되므로 조금 더 자세히 알아보자

In supervised learning, testing data values or X are input into the model. The model outputs a prediction(y^\hat y) and compares that prediction to the training data used to train the model. If the predicted test data values and actual training data values(yy) are far apart, that's called error and the model tries to reduce this error until the predicted(y^\hat y) and actual(yy) values are closer together.
This is a classic optimization problem.
지도학습의 경우, (테스트용) 입력데이터 X를 받으면 그에 대한 예측값 y을 출력
예측값 y와 실제값 y의 차이, 즉 에러를 줄이는 방향으로 모델을 업데이트함. 이게 바로 Optimization



02. Deep Learning

Now that we've explored the difference between Artificial intelligence and Machine learning, and supervised and unsupervised learning,
let's briefly explore where Deep learning fits as a subset of machine learning methods.
앞서 AI와 ML(Supervised, Unsupervised)에 대하여 알아보았다
(위그림과 같이) DL, 즉 딥러닝은 ML의 subset

While machine learning is a broad field that encompasses many different techniques, Deep Learning is a type of machine learning that uses artificial neural networks allowing them to process more complex patterns than machine learning.
[+] encompass : ~을 포함하다, 망라하다
딥러닝은 단지 Artificial Neural Network, 즉 인공신경망을 사용하는 머신러닝 중 하나이다!

Artificial Neural Networks are inspired by the human brain. They are made up of many interconnected nodes, or neurons, that can learn to perform tasks by processing data and making predictions.
Artificial Neural Network는 서로 상호작용하는 매우 많은 node, neuron로 이루어져있는 구조이며
데이터를 처리하고 예측을 하는데 사용된다

Deep learning models typically have many layers of neurons which allows them to learn more complex patterns than traditional machine learning models. And neural networks can use both labeled and unlabeled data. This is called Semi-Supervised Learning
딥러닝 모델은 (neuron들로 이루어진) Layer들을 가지고 있으며, 다른 Machine Learning 모델에 비하여 더 복잡한 패턴을 배울 수 있다
또한 NN은 labeled / unlabeled data를 가지고 학습할 수 있다
따라서 이를 반지도학습(Semi-Supervised Learning)이라고 한다.

In Semi-Supervised Learning, a neural network is trained on a small amount of labeled data and a large amount of unlabeled data. The labeled data helps the neural network to learn the basic concepts of the task.
While the unlabeled data helps the neural network to generalize to new examples.
준지도학습의 경우
적은양의 Labeled data + 많은양의 Unlabeled data를 통해 학습될 수 있다.
Labeled data를 통해서 모델은 기본 개념을 학습
Unlabeled data를 통해서 모델은 새로운 예를 일반화, 도출한다.



03. Generative AI

💛 Now we Finally get to where generative AI fits into this AI discipline. Gen AI is a subset of deep learning. which means it uses artificial neural networks can process both labeled and unlabeled data using supervised, unsupervised, and semi-supervised methods.
(마침내) 생성형 AI에 대해서 알아보자
생성형 AI는 딥러닝에 속한다. (앞서말했듯이) 딥러닝은 라벨/언라벨 데이터를 모두 사용가능한 지도/비지도/반지도학습이 가능하다


LLM(Large Language Models) are also a subset of deep learning [!]


03-1. Generative / Discriminative

Deep Learning models, or machine learning models in general, can be divided into two types, generative and discriminative.
[+] Discriminative : 식별하는, 구별되는, 식별력이 있는


🔰 Discriminative Model

A Discriminative model is a type of model that is used to classify or predict labels for data points. Discriminative models are typically trained on a data set of labeled data points. And they learn the relationship between the features of the data points and the labels.
Once a discriminative model is trained, it can be used to predict the label for new data points.
Discriminative Model은 데이터값에 대하여 '라벨'값을 분류 또는 예측함
데이터포인트들의 특성과 라벨값의 관계를 학습
훈련된 Discriminative Model은 새로운 데이터를 입력하면 그에 맞는 '라벨'을 예측하여 뱉어줄 수 있다.

[+] Classification vs Regression

"분류모델의 경우 출력값으로 '클래스'값을 뱉고 회귀모델의 경우 출력값으로 '실수'값을 뱉는다."


🔰 Generative Model

A Generative model generates new data instances based on a learned probability distribution of existing data. Thus generative models generate new content.
Generative model은 기존 데이터의 확률 분포를 기반으로 새로운 데이터 인스턴스를 생성
즉 새로운 데이터 콘텐츠를 생성




The Discriminative Model learns the conditional probability distribution or the probability of y, our output, given x, our input, that this is a dog and classifies it as a dog and not a cat.
판별 모델은 조건부 확률분포(?) 또는 y의 확률을 학습하고, 입력 x가 주어지면 이것이 'Dog', 즉 'Cat'이 아닌 것으로 분류합니다.

The Generative Model learns the joint probability distribution or the probability of x and y and predicts the conditional probability that this is a dog and can then generate a picture of a dog.
생성 모델은 결합 확률분포(?) 또는 x와 y의 확률을 학습하고, 이것이 'Dog'이며 'Dog'의 그림을 생성할 수 있는 조건부 확률을 예측합니다.

So to summarize, generative models can generate new data instances while discriminative models discriminate between different kinds of data instances.
즉 생성모델은 새로운 데이터 인스턴스를 생성하고
판별모델은 그 데이터 인스턴스를 판별해낸다


✅The top image shows a traditional machine learning model which attempts to learn the relationship between the data and the label, or what you want to predict.
(이미지 상단)
전통적인! X와 y, 즉 데이터와 라벨간의 관계를 학습하여 원하는것을 예측해내는 ML모델

✅The bottom image shows a generative AI model which attempts to learn patterns on content so that it can generate new content.
(이미지 하단)
입력되는 콘텐츠의 패턴을 학습하여 새로운 콘텐츠를 생성해내는 Genearative AI




A good way to distinguish what is gen AI and what is not is about output 'y'. It is not gen AI when the output, or y, or label is a number or a class, for example spam or not spam or a probability. It is gen AI when the output is natural language, like speech or text, an image or audio, for example.
생성형 AI이냐 아니냐를 구분하는 방법은 바로 출력값, 즉 y를 보는 것이다
(간단하게) 어떤 모델의 출력물이 숫자, 클래스값, 확률값일경우 Generative AI가 아니다
어떤 모델의 출력물이 자연어, 텍스트, 이미지, 오디오일 경우 Generative AI이다.


03-2. What is Generative AI?

[+] 간단하게 원문으로 읽어보면 되는 정도임 \downarrow

Now we come to our formal definition.

🔰 What is Generative AI?

  • Gen AI is a type of Artificial Intelligence that creates new content based on what is has learned from existing content.

  • The process of learning from existing content is called training and results in the creation of a statistical model.

  • When given a prompt, Gen AI uses this statistical model to predict what an expected response might be-and this generates new content.


Essentially, it learns the underlying structure of the data and can then generate new samples that are similar to the data it was trained on. As previously mentioned, a generative language model can take what it is learned from the examples it's been shown and create something entirely new based on that information. Large language models are one type of generative AI. since they generate novel combinations of text in the form of natural sounding language.


A generative image model takes an image as input and can output text, another image, or video.
For example,

  • output-Text : you can get VQA (Visual Question Answering) (이미지를 입력하고 그 이미지에 대한 질문을 했을때 답변받는것)
  • output-Image : An image completion (이미지의 일부분이 생략되어있을때, 이에 대한 Fill을 수행하는것) is generated
  • output-Video : Animation is generated


A generative Text model takes text as input and can output more text an image, audio, or decisions.
For example,

  • output-Text : Qeustion Answering is generated
    ...


The power of generative AI comes from the use of Transformers, (At a high level,) A Transformer model consists of an encoder and decoder. The encoder encodes the input sequence and passes it to the decoder which learns how to decode the representation for a relevant task.


In Transformers, Hallucinations are words or phrases that are generated by the model that are often nonsensical or grammatically incorrect.

profile
예술과 기술

0개의 댓글