전체 글
-
LLM ParametersInternship_LLM 2024. 1. 26. 12:11
LLM에서 hallucination을 제거하는 요소이기도 하며, Inference 시에 자주 사용되는 Hyper-Parameters 들을 정리해보려고 한다. ※ Temperature - 언어 모델 출력의 무작위성을 제어하는 하이퍼파라미터이다. - 높을 수록 예측하기 어렵고, 창의적인 결과가 생성되며 모델의 출력에 대한 "신뢰도"가 낮아지게 된다. - 낮을 수록 결정적이고 보수적인 결과가 생성되므로 예측가능한 출력이 생성된다. 예를 들어, 0.5로 temperature를 조정하면, 1.0으로 temperature를 설정할 때보다 더 예측하기 쉽고 덜 창의적인 텍스트가 생성되는 것이다. 애플리케이션의 경우 사실을 기반으로 하는 질의응답과 같은 작업에서는 낮은 temperature를 사용해서 사실적이고 간결한..
-
Instruction finetuning & Self-InstructInternship_LLM 2024. 1. 26. 10:54
Instruction tuning과 Self-Instruct에 대한 간단한 code 흐름을 정리해보려고 한다. ※ Instruction tuning instruction dataset이 json 파일이라면, with open등으로 json 파일을 받아와서 데이터프레임 형식으로 변환한다. 사용할 토크나이저와 모델을 만든다. transformers 기반의 AutoTokenizer를 사용하고, pretrained된 모델을 넣어서 토크나이징 instruction tuning시에는 AutoModelForSeq2SeqLM을 사용하여 모델을 만들어 주는것이 일반적이므로 model_name = "bert-base-uncased" # 예시 모델 이름 tokenizer = AutoTokenizer.from_pretrain..
-
백준 1082 - 방 번호Algorithm/Dynamic Programming 2024. 1. 25. 09:44
1082번: 방 번호 (acmicpc.net) 1082번: 방 번호 첫째 줄에 N이 주아진다. 둘째 줄에는 공백으로 구분된 P0, ..., PN-1이 주어진다. 마지막 줄에는 M이 주어진다. www.acmicpc.net 이번주에 알고리즘 공유 문제는 방 번호 문제이다. 이 문제는 dynamic programming과 Greedy Algorithm을 모두 떠올려야하는 문제로 점화식 작성을 할 때 Greedy를 생각하지 않으면 쉽사리 작성할 수 없는 문제이다. 문제를 먼저 이해해보자. 예제 입력 1 복사 3 6 7 8 21 예제 출력 1 복사 210 이렇게 6 7 8 을 입력받게 될 때 방 번호는 각각 0 1 2가 될 것이다. 방 가격 : 6 7 8 방 번호 : 0 1 2 이런 모습이 나오게 되는데 여기서 ..
-
SELF-INSTRUCT 논문 리뷰Internship_LLM 2024. 1. 24. 17:46
Instruction dataset에 대한 가공을 끝낸 후, 이어서 self-instruct에 대한 논문을 리뷰해보면 좋을 것 같아 선택한 논문이다. instruction 데이터를 자체적으로 생성하여 수준 높은 instruction dataset을 구축할 수 있다는 논문이다. [2212.10560] Self-Instruct: Aligning Language Models with Self-Generated Instructions (arxiv.org) Self-Instruct: Aligning Language Models with Self-Generated Instructions Large "instruction-tuned" language models (i.e., finetuned to respond to..
-
백준 1052 - 물병Algorithm/Greedy 2024. 1. 16. 09:29
1052번: 물병 (acmicpc.net) 1052번: 물병 지민이는 N개의 물병을 가지고 있다. 각 물병에는 물을 무한대로 부을 수 있다. 처음에 모든 물병에는 물이 1리터씩 들어있다. 지민이는 이 물병을 또 다른 장소로 옮기려고 한다. 지민이는 한 번 www.acmicpc.net 요즘 근래 너무 골드3 문제에 치여서 좀 쉬운 문제를 풀면서 다시 코테 흥미를 높여볼까 생각하면서 실버1 문제를 건드려보았다. 근데 이게 뭔가 싶은데... 누가봐도 그리디 문제인데, 뭐 도통 이해가 안되는 문제를 만나서 한참을 헤메게 되었다. 이 문제를 스터디원들과 꼭 공유해보고자 블로그를 작성한다. ※ 문제의 규칙성 이 문제는 규칙을 발견하면 사실상 문제가 끝난다고 보면된다. 코드도 정말 간단하기 때문에... 충격적이었다...
-
백준 1174 - 우주신과의 교감Algorithm/Graph 2024. 1. 14. 11:29
1774번: 우주신과의 교감 (acmicpc.net) 1774번: 우주신과의 교감 (1,1) (3,1) (2,3) (4,3) 이렇게 우주신들과 황선자씨의 좌표가 주어졌고 1번하고 4번이 연결되어 있다. 그렇다면 1번하고 2번을 잇는 통로를 만들고 3번하고 4번을 잇는 통로를 만들면 신들과 선자씨끼 www.acmicpc.net 문제를 살펴보면서 "새로 만들어야 할 정신적인 통로의 길이들이 합이 최소가 되게 통로를 만들어 “빵상”을 외칠수 있게 도와주자." 이 문장과 좌표들을 입력받는 것을 통해 거리의 합을 구하고, 최소가 될 수 있는 통로를 만들어주어야 한다고 생각했다. 문제를 보면 예전에 풀어보았던 최소 스패닝 트리 문제가 떠오르게 되어, 전체적인 알고리즘을 최소 스패닝 트리 문제와 동일하게 가져갔다. ..
-
GPT - 1.0 논문 리뷰Internship_LLM 2024. 1. 12. 17:40
지난 시간에는 BERT 논문을 리뷰해보았는데, 오늘은 BERT와 정확히 반대로 decoder를 건드린 GPT 논문을 리뷰해보려고 한다. 최근 OpenAI의 ChatGPT가 너무나 뛰어난 성능을 보여주면서, BERT를 잘 사용하지 않는 지경에 이르렀고 NLP가 chatGPT로 대통합되는 느낌을 받고 있는데, 그 시초가 되는 논문을 리뷰해보려고 한다. language_understanding_paper.pdf (openai.com) Abstract 일반적인 자연어 이해는 textual entailment, QA, sematic similarity assessment, Text Classification 등의 다양한 범위의 task로 구성이 된다. 하지만, large unlabeled text corpora는..
-
BERT 논문 리뷰Internship_LLM 2024. 1. 9. 14:43
지난 시간에 Attention Is All You Need를 통해서 Transformer 논문을 리뷰해보았다. 이번 시간에는 Transformer를 활용한 BERT 모델 논문을 리뷰해보고자 한다. [1810.04805] BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (arxiv.org) BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding We introduce a new language representation model called BERT, which stands for Bidirectional Encoder ..