본문 바로가기

자연어 처리 과정

(62)
Autograd explained diagram References https://www.youtube.com/watch?v=MswxJw-8PvE
The differences between InstructGPT and ChatGPT Two of them are both the model aligned by human feedback, which is called RLHF, and trained with instruction fine-tuning. The differences of them is below. References https://www.theinsaneapp.com/2023/05/instructgpt-vs-chatgpt.html
Chain rule practice Problem 1. Explanation Problem 2. Explanation References https://cs182sp21.github.io CS 182: Deep Learning Head uGSI Brandon Trabucco btrabucco@berkeley.edu Office Hours: Th 10:00am-12:00pm Discussion(s): Fr 1:00pm-2:00pm cs182sp21.github.io
Transformer: Scaled dot-product attention * "Attention is all you need"의 저자들이 주장한 바를 바탕으로 하며, 글의 내용은 그 주장을 읽은 저의 이해를 바탕으로 채워졌습니다. 개요 왜 dot-product attention이 아닌 scaled dot-product attention을 사용하는가? Scaled dot-product attention을 사용하는 이유 Attention process에 대해 backpropagation을 진행할 때 gradient가 소멸되는 일을 방지하기 위해 scaled dot-product를 사용하여 attention vector를 만든다. Scaling을 하지 않은 dot-product를 이용하여 attention을 하는 경우 아래와 같이 attention weight를 만든다. 즉, sc..
Transformer: Multi-head attention 개요 Single-head attention의 단점을 살펴봄으로써 Multi-head attention이 고안된 이유를 알아보자. 그리고 multi-head attention의 장점은 무엇인지 살펴보자. 목차 1. Single-head attention과 그 문제점 2. Multi-head attention과 mechanism Single-head attention과 그 문제점 Transformer 구조에서 나타나는 multi-head attention mechanism이 아닌 RNN sequence to sequnce 모델에 적용되었던 attention mechanism은 single-head attention이라고 할 수 있다. RNN sequence to sequence의 bottleneck pro..
Quotient rule for derivative of softmax with respect to fk(x)
What does "linear in parameters" mean in linear regression? https://datascience.stackexchange.com/questions/12274/what-does-linear-in-parameters-mean What does "linear in parameters" mean? The model of linear regression is linear in parameters. What does this actually mean? datascience.stackexchange.com
Backpropagation Drawing computation graphs 현재까지의 과정을 통해 알아보았던 task로는 linear regression과 logistic regression이 존재했다. 이번에는 그 모델들이 prediction을 만드는 과정과 prediction이 loss function에 입력되는 과정을 computation graph로 표현해보고자 한다. 이 과정을 통해 먼저 모델들의 forward pass 과정을 이해해보자. Computation graph of Linear regression 먼저 linear regression의 가설을 만들기 위한 parameter로는 $\theta$만이 존재한다고 가정한다. 그리고 data는 2개가 존재해서 $x_1$, $x_2$가 존재한다고 가정한다. 그렇다면 lin..
Regularization * 이전 글과 내용이 이어집니다. https://onebyonebyone.tistory.com/191 Error analysis Empirical risk 우리가 모델 학습을 위해서 가설과 loss function을 정의하는 것까지 완료했다고 생각해보자. 그럼 이제 우리는 모델을 학습할 일만 남았다. 그런데 여기서 한 가지 의문이 생길 수 있다. onebyonebyone.tistory.com How do we regulate bias and variance? 우리는 overfitting과 underfitting 발생 원인이 variance와 bias의 tradeoff라는 것을 알게 되었다. 그럼 variance와 bias를 어떻게 잘 조절하면 overfitting과 underfitting의 문제를 해소할..
Error analysis Empirical risk 우리가 모델 학습을 위해서 가설과 loss function을 정의하는 것까지 완료했다고 생각해보자. 그럼 이제 우리는 모델을 학습할 일만 남았다. 그런데 여기서 한 가지 의문이 생길 수 있다. Q. 우리 모델이 data를 잘 학습하고 있다는 걸 어떻게 확인할 수 있을까? 이러한 의문을 해소하기 위해서 고안된 것이 empirical risk이다. 우선 risk란, 우리 모델의 예측이 틀릴 확률을 말한다. 따라서 empirical risk는 우리가 가지고 있는 train dataset에 대해 우리 모델의 예측이 틀릴 가능성을 나타내준다. train loss라고 간주해도 무방할 것 같다고 생각한다. 그럼 도대체 이 empirical risk는 어떻게 구할 수 있는 것일까? Risk ..