Skip to content

Python

[論文解讀] Kangaroo: Lossless Self-Speculative Decoding via Double Early Exiting

前言

這是華為諾亞方舟實驗室所提出加速框架,本質上是把原先投機解碼(speculative decoding)中所使用的小模型由大模型的淺層網路取代,並再由額外訓練的適配器(adapter)加上模型本身的解碼頭去生成推測的 token,再由大模型去進行驗證,並在拒絕推測 token 時由大模型所生成的機率分佈解碼結果取代 —— 這些操作與原先的 speculative decoding 其實沒有太大差別。

Read More »[論文解讀] Kangaroo: Lossless Self-Speculative Decoding via Double Early Exiting

使用 snapshot_download 下載 HuggingFace Hub 上的模型

介紹

HuggingFace Model Hub 現在已經是無人不知、無人不曉的重要開源平台了,每天都有無數的人或組織上傳自己訓練出來的最新模型(包含文字、圖像、語音…… 等等不同領域)到這個平台上。可說是現在凡舉是個做 AI 相關工作的人,想必都會經常瀏覽 HuggingFace 他們的家的平台網站。

Read More »使用 snapshot_download 下載 HuggingFace Hub 上的模型

Direct Preference Optimization (DPO) 訓練方法筆記

介紹

DPODirect Preference Optimization, 直接偏好優化)是一種取代 RLHFReinforcement Learning from Human Feedback, 基於人類反饋的強化學習)的微調方式。眾所皆知,大型語言模型在經過非監督式學習後能夠學習到大量的知識與理解能力(有些研究者認為是『壓縮並保存』了知識在神經網路權重中);在監督式學習後學會了流暢地回應我們的問題,或者說是學會了『對話』的能力。

Read More »Direct Preference Optimization (DPO) 訓練方法筆記

LeetCode: 661-Image Smoother 解題紀錄

題目

An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cells in the blue smoother). If one or more of the surrounding cells of a cell is not present, we do not consider it in the average (i.e., the average of the four cells in the red smoother).

Read More »LeetCode: 661-Image Smoother 解題紀錄