| name | description |
|---|---|
EXPERIMENT_NAME |
[Experiment Type] Skill. Usage: (1) [Scenario 1], (2) [Scenario 2], (3) [Scenario 3]. Tested on [Verification Model/Environment]. |
| Item | Details |
1. REAP ๊ณต์
REAP Score = mean(||expert_output|| ร router_weight)
- ||expert_output||: ์ ๋ฌธ๊ฐ ์ถ๋ ฅ์ L2 norm
- router_weight: softmax(router_logits)์์ ํด๋น ์ ๋ฌธ๊ฐ์ ๊ฐ์ค์น
- ๊ฐ ์ ๋ฌธ๊ฐ์ ์ค์ ๋ก ๋ผ์ฐํ
๋ ํ ํฐ๋ค๋ง ๋์์ผ๋ก ๊ณ์ฐ
| import argparse | |
| import os | |
| import pandas as pd | |
| import vertexai | |
| from google.cloud.aiplatform import pipeline_jobs | |
| from google.cloud.aiplatform.models import Model # For type hinting deployed_model | |
| from vertexai.language_models import TextEmbeddingInput, TextEmbeddingModel | |
| from google.oauth2 import service_account # <--- [์์ ๋จ] ๋ชจ๋ ์ํฌํธ | |
| # --- Configuration (can be overridden by argparse) --- |
| # Frontend Design Guideline | |
| This document summarizes key frontend design principles and rules, showcasing | |
| recommended patterns. Follow these guidelines when writing frontend code. | |
| # Readability | |
| Improving the clarity and ease of understanding code. |
| import pytorch_lightning as pl | |
| import numpy as np | |
| import torch | |
| from torch.nn import MSELoss | |
| from torch.optim import Adam | |
| from torch.utils.data import DataLoader, Dataset | |
| import torch.nn as nn | |
| class SimpleDataset(Dataset): |
| import cupy as cp | |
| import numpy as np | |
| from pylibraft.distance import pairwise_distance | |
| from pylibraft.knn import brute_force_knn | |
| def main(num_elements, dim): | |
| # ๋ฐ์ดํฐ ์์ฑ ๋ฐ ์ ๊ทํ (CuPy ์ฌ์ฉ) | |
| cp.random.seed(42) | |
| data = cp.random.random((num_elements, dim)).astype(cp.float32) | |
| norm_data = data / cp.linalg.norm(data, axis=1, keepdims=True) |
| import argparse | |
| import hnswlib | |
| import numpy as np | |
| def main(num_elements, dim): | |
| # ๋ฐ์ดํฐ ์์ฑ ๋ฐ ์ ๊ทํ | |
| np.random.seed(42) | |
| data = np.random.random((num_elements, dim)).astype(np.float32) | |
| norm_data = data / np.linalg.norm(data, axis=1)[:, None] |
Gopher๋งํผ ๊ณ์ฐ๋์ด ์๋ค๋ฉด 63B โ 1.4T์์ ํ์ตํ๋ ๊ฒ์ด ์ต์ ์ด๋ผ๊ณ ํ๋ค. ์ค์ ํ์ ์์๋ ๊ด์ 2๊ฐ ์กฐ๊ธ ๋ ํ์ค์ฑ์ด ์๋๋ฐ, pretrain์ ํ๊ธฐ ์ ์ ์ด๋ฏธ GPU๋ฅผ ์ฌ์ฉํ์ผ๋ฏ๋ก ๊ณ์ฐ๋์ด ๊ณ ์ ๋์ด ์๋ ์ํ. ์ต๊ณ ์ ์ ํ๋๋ฅผ ๋ด๊ธฐ ์ํด์ ๋ชจ๋ธ ํฌ๊ธฐ๋ฅผ ์ด๋ป๊ฒ ์กฐ์ ํด์ผ ํ๋์ง ๊ทธ๋ํ๋ฅผ ํตํด์ ๊ฒฐ๋ก ์ ๋ผ ์ ์์ ๊ฒ์ด๋ค. ์๋๋ ์นดํ์๋ nanoGPT์์ ๊ด์ 2๋ฅผ ์ข์ํ๋ค๊ณ ์ธ๊ธํ๋ค.
Figure 3 > Figure 2 ๋ ์ดํดํ๊ธฐ ํธํ๋ค.
๊ด์ 1๊ณผ ๊ด์ 2์์ ์ป์ ๋ฐ์ดํฐ๋ฅผ ์กฐ๊ธ ๋ ์ ํด์ํ๋ ๋ฐฉํฅ์ผ๋ก ์ ์ํ๋ ๊ฒ์ธ๋ฐ, ์ฐ๋ฆฌ๊ฐ ๋ฐ์ดํฐ ํฌ์ธํธ๋ฅผ 400๊ฐ ๋ชจ์๋๋ฐ ์ต์ข ๋ก์ค๋ฅผ ์์ธกํ ์ ์๋ ๋ชจ๋ธ์ ๋ง๋ค๋ฉด ์ด๋จ๊น? ๋ผ๋ ์๊ฐ์ด๊ณ ์ ์ํธ๋ง๋ ๋ด๋ถ ์ธํฐ๋ทฐ๋ฅผ ํตํด์ ์ต์ด ํ์ต ์กฐ๊ธ ํ๋ฉด ์ต์ข ๋ก์ค๋ฅผ ์ ์ ์๋ค๋ ๋ด์ฉ ๋งํ์. ๋ก์ค ์์ธก ๋ชจ๋ธ์ ์ ์ด์ผ๊ธฐํ๋ฉด ๋ชจ๋ธ ํฌ๊ธฐ๋ ์ผ๋ง๋ ๋์ด์ผ ํ๊ณ ๋ฐ์ดํฐ์ ์ ์ผ๋ง๋ ํ์ํ์ง ์ ์์ธกํ ์ ์์ ๊ฒ์ด๋ค. GPU ์ค์ผ์ค๋ง์ด ์ฌ์์ง๋ค๋์ง, ์ด ์ฌ๋์๊ฒ ๋ช ๋๋ฅผ ๋น๋ ค์ฃผ๋ฉด ๋๋์ง ๋ฑ ์ ๋น๋ ค์ฃผ๋ ๊ฒ์ด ์ข์ ์ ์๋ค. ์ ์๋ค์ ๋ก์ค ์์ธก ๋ชจ๋ธ์ ์ ๋ ๊ฒ ์๊ธธ ์ ์์ง ์์๊น? ์ด์ผ๊ธฐํ๊ณ . L-BFGS ์๊ณ ๋ฆฌ์ฆ์ ์ด์ฉํด์ Huber ๋ก์ค๋ฅผ ์ต์ํํ๋ ๋ฐฉํฅ์ผ๋ก ํ์ตํ๋ฉด ํ๋ผ๋ฏธํฐ๋ฅผ ์ฑ์ธ ์ ์๋ค๊ณ ํ๋ค.