import React, { useState, useEffect } from "react"; import { MatrixViz } from "../components/MatrixViz"; import { useLanguage } from "../App"; import { Play, Pause, FileText, Headphones, Zap, Volume2, X, } from "lucide-react"; export const BlogPost: React.FC = () => { const { language } = useLanguage(); const [activeSection, setActiveSection] = useState("intro"); const [activeTab, setActiveTab] = useState<"read" | "listen">("read"); const [isPlaying, setIsPlaying] = useState(false); const [showMiniPlayer, setShowMiniPlayer] = useState(false); // Simple scroll spy logic useEffect(() => { const handleScroll = () => { const sections = ["intro", "methods", "results", "discussion"]; for (const section of sections) { const element = document.getElementById(section); if (element) { const rect = element.getBoundingClientRect(); if (rect.top >= 0 && rect.top <= 300) { setActiveSection(section); break; } } } }; window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); const handleMainPlayPause = () => { const newState = !isPlaying; setIsPlaying(newState); if (newState) { setShowMiniPlayer(true); } }; const content = { en: { title: "LoRA Without Regret", subtitle: "John Schulman in collaboration with Pradit", date: "Sep 29, 2025", tldr_title: "Executive Summary (TL;DR)", tldr_text: "Low-Rank Adaptation (LoRA) is a technique to fine-tune large models efficiently. Our research confirms that while LoRA saves 90% of memory, it can match full fine-tuning performance only if the rank (r) is sufficiently high and alpha scaling is tuned correctly. Ideal for post-training but not pre-training.", tabs: { read: "Read Article", listen: "Listen (TTS)" }, intro_1: "Today’s leading language models contain upwards of a trillion parameters, pretrained on tens of trillions of tokens. Base model performance keeps improving with scale, as these trillions are necessary for learning and representing all the patterns in written-down human knowledge.", intro_2: "In contrast, post-training involves smaller datasets and generally focuses on narrower domains of knowledge and ranges of behavior. It seems wasteful to use a terabit of weights to represent updates from a gigabit or megabit of training data. This intuition has motivated parameter efficient fine-tuning (PEFT), which adjusts a large network by updating a much smaller set of parameters.", method_title: "The Method", method_1: "The leading PEFT method is low-rank adaptation, or LoRA. LoRA replaces each weight matrix W from the original model with a modified version W' = W + γBA, where B and A are matrices that together have far fewer parameters than W, and γ is a constant scaling factor.", method_2: "In effect, LoRA creates a low-dimensional representation of the updates imparted by fine-tuning. LoRA may offer advantages in the cost and speed of post-training, and there are also a few operational reasons to prefer it to full fine-tuning.", results_title: "Operational Advantages", results_list: [ { title: "Multi-tenant serving", text: "Since LoRA trains an adapter (i.e., the A and B matrices) while keeping the original weights unchanged, a single inference server can keep many adapters in memory.", }, { title: "Layout size for training", text: "FullFT usually requires an order of magnitude more accelerators than sampling from the same model does.", }, { title: "Ease of loading", text: "With fewer weights to store, LoRA adapters are fast and easy to set up or transfer between machines.", }, ], conclusion_title: "Conclusion", conclusion_text: "The question remains: can LoRA match the performance of full fine-tuning? Our internal benchmarks suggest yes, provided rank scaling is carefully managed.", nav: { intro: "Introduction", methods: "Methods", results: "Results", discussion: "Conclusion", }, now_playing: "Now Playing", paused: "Paused", transcript_title: "Transcript", }, th: { title: "LoRA โดยไม่เสียใจ", subtitle: "John Schulman ร่วมกับ Pradit (ประดิษฐ์)", date: "29 กันยายน 2025", tldr_title: "บทสรุปผู้บริหาร (TL;DR)", tldr_text: "Low-Rank Adaptation (LoRA) เป็นเทคนิคการปรับแต่งโมเดลขนาดใหญ่ที่มีประสิทธิภาพ งานวิจัยของเรายืนยันว่าแม้ LoRA จะประหยัดหน่วยความจำได้ถึง 90% แต่จะให้ผลลัพธ์เทียบเท่าการ Fine-tune แบบเต็มรูปแบบได้ก็ต่อเมื่อค่า Rank (r) สูงเพียงพอและมีการปรับค่า Alpha อย่างถูกต้อง เหมาะสำหรับขั้นตอน Post-training แต่ไม่เหมาะกับ Pre-training", tabs: { read: "อ่านบทความ", listen: "ฟังเสียงบรรยาย" }, intro_1: "โมเดลภาษาชั้นนำในปัจจุบันมีพารามิเตอร์มากกว่าล้านล้านตัว ผ่านการฝึกฝนบนข้อมูลมหาศาล ประสิทธิภาพของโมเดลพื้นฐานดีขึ้นเรื่อยๆ ตามขนาด ซึ่งจำเป็นสำหรับการเรียนรู้รูปแบบความรู้ทั้งหมดของมนุษย์", intro_2: "ในทางตรงกันข้าม การฝึกฝนหลังเสร็จสิ้น (Post-training) มักใช้ชุดข้อมูลขนาดเล็กและเน้นขอบเขตความรู้ที่แคบกว่า ดูเหมือนจะสิ้นเปลืองที่จะใช้น้ำหนักระดับเทราบิตเพื่อแทนการอัปเดตจากข้อมูลเพียงกิกะบิต แนวคิดนี้จึงนำไปสู่การปรับแต่งแบบประหยัดพารามิเตอร์ (PEFT)", method_title: "วิธีการ", method_1: "วิธี PEFT ชั้นนำคือ Low-rank adaptation หรือ LoRA ซึ่งแทนที่เมทริกซ์น้ำหนัก W แต่ละตัวด้วยเวอร์ชันแก้ไข W' = W + γBA โดยที่ B และ A เป็นเมทริกซ์ที่มีพารามิเตอร์น้อยกว่า W มาก", method_2: "โดยสรุป LoRA สร้างตัวแทนมิติที่ต่ำกว่าของการอัปเดตที่เกิดจากการ Fine-tuning LoRA อาจมีข้อได้เปรียบในด้านต้นทุนและความเร็ว และยังมีเหตุผลด้านการปฏิบัติงานที่ทำให้เป็นที่นิยมมากกว่า Full Fine-tuning", results_title: "ข้อได้เปรียบด้านการปฏิบัติงาน", results_list: [ { title: "การให้บริการแบบ Multi-tenant", text: "เนื่องจาก LoRA ฝึกฝน Adapter (เมทริกซ์ A และ B) โดยไม่เปลี่ยนน้ำหนักเดิม เซิร์ฟเวอร์เดียวจึงสามารถเก็บ Adapter หลายตัวในหน่วยความจำได้", }, { title: "ขนาด Layout สำหรับการฝึก", text: "FullFT มักต้องการตัวเร่งความเร็ว (GPU/TPU) มากกว่าการสุ่มตัวอย่างจากโมเดลเดียวกันถึงหนึ่งระดับ (Order of magnitude)", }, { title: "ความง่ายในการโหลด", text: "ด้วยน้ำหนักที่ต้องเก็บน้อยกว่า LoRA adapters จึงตั้งค่าและโอนย้ายระหว่างเครื่องได้รวดเร็ว", }, ], conclusion_title: "บทสรุป", conclusion_text: "คำถามยังคงอยู่: LoRA สามารถทำงานได้เทียบเท่ากับ Full Fine-tuning หรือไม่? การทดสอบภายในของเราชี้ว่า 'ได้' หากมีการจัดการ Rank scaling อย่างระมัดระวัง", nav: { intro: "บทนำ", methods: "วิธีการ", results: "ผลลัพธ์", discussion: "บทสรุป", }, now_playing: "กำลังเล่น", paused: "หยุดชั่วคราว", transcript_title: "คำบรรยาย", }, }; const t = content[language]; return (
{/* Article Header */}

{t.title}

{t.subtitle}
{/* View Tabs */}
{/* TL;DR Section */}

{t.tldr_title}

{t.tldr_text}

{activeTab === "listen" ? ( /* Voice Interface */
{/* Left: Sticky Player */}
{isPlaying && ( )}

{t.title}

Voice: Gemini 2.5 Flash TTS

{/* Fake Waveform */}
{[...Array(30)].map((_, i) => (
))}
{/* Right: Scrollable Transcript */}
{t.transcript_title}

{t.intro_1}

{t.intro_2}

{t.method_title}

{t.method_1}

{t.method_2}

{t.results_title}

{t.results_list.map((item, idx) => (

{item.title}:{" "} {item.text}

))}

{t.conclusion_text}

) : ( /* Read Interface */
{/* Left Sidebar - TOC */} {/* Main Content */}

{t.intro_1}

{t.intro_2}

{t.method_title}

{t.method_1}

{t.method_2}

{t.results_title}

    {t.results_list.map((item, idx) => (
  • {item.title}.{" "} {item.text}
  • ))}

{t.conclusion_title}

{t.conclusion_text}

{/* Right Sidebar - Footnotes */}
)} {/* Mini Player Overlay - Persistent if showMiniPlayer is true */} {showMiniPlayer && activeTab === "read" && (
{isPlaying && ( )}
{isPlaying ? t.now_playing : t.paused} {t.title}
)}
); };