YouZum

Committee

AI, Committee, ニュース, Uncategorized

The Download: the fossil fuel elephant in the room, and better tests for endometriosis

This is today’s edition of The Download, our weekday newsletter that provides a daily dose of what’s going on in the world of technology. This year’s UN climate talks avoided fossil fuels, again Over the past few weeks in Belem, Brazil, attendees of this year’s UN climate talks dealt with oppressive heat and flooding, and at one point a literal fire broke out, delaying negotiations. The symbolism was almost too much to bear. While many, including the president of Brazil, framed this year’s conference as one of action, the talks ended with a watered-down agreement. The final draft doesn’t even include the phrase “fossil fuels.” As emissions and global temperatures reach record highs again this year, I’m left wondering: Why is it so hard to formally acknowledge what’s causing the problem? —Casey Crownhart This article is from The Spark, MIT Technology Review’s weekly climate newsletter. To receive it in your inbox every Wednesday, sign up here. New noninvasive endometriosis tests are on the rise Endometriosis inflicts debilitating pain and heavy bleeding on more than 11% of reproductive-­age women in the United States. Diagnosis takes nearly 10 years on average, partly because half the cases don’t show up on scans, and surgery is required to obtain tissue samples. But a new generation of noninvasive tests are emerging that could help accelerate diagnosis and improve management of this poorly understood condition. Read the full story. —Colleen de Bellefonds This story is from the last print issue of MIT Technology Review magazine, which is full of fascinating stories about the body. If you haven’t already, subscribe now to receive future issues once they land. The must-reads I’ve combed the internet to find you today’s most fun/important/scary/fascinating stories about technology. 1 OpenAI claims a teenager circumvented its safety features before ending his lifeIt says ChatGPT directed Adam Raine to seek help more than 100 times. (TechCrunch)+ OpenAI is strongly refuting the idea it’s liable for the 16-year old’s death. (NBC News)+ The looming crackdown on AI companionship. (MIT Technology Review) 2 The CDC’s new deputy director prefers natural immunity to vaccinesAnd he wasn’t even the worst choice among those considered for the role. (Ars Technica)+ Meet Jim O’Neill, the longevity enthusiast who is now RFK Jr.’s right-hand man. (MIT Technology Review) 3 An MIT study says AI could already replace 12% of the US workforceResearchers drew that conclusion after simulating a digital twin of the US labor market. (CNBC)+ Separate research suggests it could replace 3 million jobs in the UK, too. (The Guardian)+ AI usage looks unlikely to keep climbing. (Economist $) 4 An Italian defense group has created an AI-powered air shield systemIt claims the system allows defenders to generate dome-style missile shields. (FT $)+ Why Trump’s “golden dome” missile defense idea is another ripped straight from the movies. (MIT Technology Review) 5 The EU is considering a ban on social media for under-16sFollowing in Australia’s footsteps, whose own ban comes into power next month. (Politico)+ The European Parliament wants parents to decide on access. (The Guardian) 6 Why do so many astronauts keep getting stuck in space?America, Russia and now China have had to contend with this situation. (WP $)+ A rescue craft for three stranded Chinese astronauts has successfully reached them. (The Register) 7 Uploading pictures of your hotel room could help trafficking victimsA new app uses computer vision to determine where pictures of generic-looking rooms were taken. (IEEE Spectrum) 8 This browser tool turns back the clock to a pre-AI slop webBack to the golden age of pre-November 30 2022. (404 Media)+ The White House’s slop posts are shockingly bad. (NY Mag $)+ Animated neo-Nazi propaganda is freely available on X. (The Atlantic $) 9 Grok’s “epic roasts” are as tragic as you’d expectTest it out at parties at your own peril. (Wired $) 10 Startup founders dread explaining their jobs at Thanksgiving Yes Grandma, I work with computers. (Insider $) Quote of the day “AI cannot ever replace the unique gift that you are to the world.” —Pope Leo XIV warns students about the dangers of over-relying on AI, New York Magazine reports. One more thing Why we should thank pigeons for our AI breakthroughs People looking for precursors to artificial intelligence often point to science fiction or thought experiments like the Turing test. But an equally important, if surprising and less appreciated, forerunner is American psychologist B.F. Skinner’s research with pigeons in the middle of the 20th century. Skinner believed that association—learning, through trial and error, to link an action with a punishment or reward—was the building block of every behavior, not just in pigeons but in all living organisms, including human beings. His “behaviorist” theories fell out of favor in the 1960s but were taken up by computer scientists who eventually provided the foundation for many of the leading AI tools. Read the full story. —Ben Crair We can still have nice things A place for comfort, fun and distraction to brighten up your day. (Got any ideas? Drop me a line or skeet ’em at me.) + I hope you had a happy, err, Green Wednesday if you partook this year.+ Here how to help an endangered species from the comfort of your own home.+ Polly wants to FaceTime—now! (thanks Alice!)+ I need Macaulay Culkin’s idea for another Home Alone sequel to get greenlit, stat.

The Download: the fossil fuel elephant in the room, and better tests for endometriosis 投稿を読む »

AI, Committee, ニュース, Uncategorized

Does Understanding Inform Generation in Unified Multimodal Models? From Analysis to Path Forward

arXiv:2511.20561v1 Announce Type: cross Abstract: Recent years have witnessed significant progress in Unified Multimodal Models, yet a fundamental question remains: Does understanding truly inform generation? To investigate this, we introduce UniSandbox, a decoupled evaluation framework paired with controlled, synthetic datasets to avoid data leakage and enable detailed analysis. Our findings reveal a significant understanding-generation gap, which is mainly reflected in two key dimensions: reasoning generation and knowledge transfer. Specifically, for reasoning generation tasks, we observe that explicit Chain-of-Thought (CoT) in the understanding module effectively bridges the gap, and further demonstrate that a self-training approach can successfully internalize this ability, enabling implicit reasoning during generation. Additionally, for knowledge transfer tasks, we find that CoT assists the generative process by helping retrieve newly learned knowledge, and also discover that query-based architectures inherently exhibit latent CoT-like properties that affect this transfer. UniSandbox provides preliminary insights for designing future unified architectures and training strategies that truly bridge the gap between understanding and generation. Code and data are available at https://github.com/PKU-YuanGroup/UniSandBox

Does Understanding Inform Generation in Unified Multimodal Models? From Analysis to Path Forward 投稿を読む »

AI, Committee, ニュース, Uncategorized

Learn the Ropes, Then Trust the Wins: Self-imitation with Progressive Exploration for Agentic Reinforcement Learning

arXiv:2509.22601v3 Announce Type: replace-cross Abstract: Reinforcement learning (RL) is the dominant paradigm for sharpening strategic tool use capabilities of LLMs on long-horizon, sparsely-rewarded agent tasks, yet it faces a fundamental challenge of exploration-exploitation trade-off. Existing studies stimulate exploration through the lens of policy entropy, but such mechanical entropy maximization is prone to RL instability due to the multi-turn distribution shifting. In this paper, we target the progressive exploration-exploitation balance under the guidance of the agent’s own experiences without succumbing to either entropy collapsing or runaway divergence. We propose SPEAR, a self-imitation learning (SIL) recipe for training agentic LLMs. It extends the vanilla SIL, where a replay buffer stores good experience for off-policy update, by gradually steering the policy entropy across stages. Specifically, the proposed curriculum scheduling harmonizes intrinsic reward shaping and self-imitation to 1) expedite exploration via frequent tool interactions at the beginning, and 2) strengthen exploitation of successful tactics upon convergence towards familiarity with the environment. We also combine bag-of-tricks of industrial RL optimizations for a strong baseline Dr.BoT to demonstrate our effectiveness. In ALFWorld and WebShop, SPEAR increases the success rates of GRPO/GiGPO/Dr.BoT by up to 16.1%/5.1%/8.6% and 20.7%/11.8%/13.9%, respectively. In AIME24 and AIME25, SPEAR boosts Dr.BoT by up to 3.8% and 6.1%, respectively. Such gains incur only 10%-25% extra theoretical complexity and negligible runtime overhead in practice, demonstrating the plug-and-play scalability of SPEAR.

Learn the Ropes, Then Trust the Wins: Self-imitation with Progressive Exploration for Agentic Reinforcement Learning 投稿を読む »

AI, Committee, ニュース, Uncategorized

MTA: A Merge-then-Adapt Framework for Personalized Large Language Model

arXiv:2511.20072v2 Announce Type: new Abstract: Personalized Large Language Models (PLLMs) aim to align model outputs with individual user preferences, a crucial capability for user-centric applications. However, the prevalent approach of fine-tuning a separate module for each user faces two major limitations: (1) storage costs scale linearly with the number of users, rendering the method unscalable; and (2) fine-tuning a static model from scratch often yields suboptimal performance for users with sparse data. To address these challenges, we propose MTA, a Merge-then-Adapt framework for PLLMs. MTA comprises three key stages. First, we construct a shared Meta-LoRA Bank by selecting anchor users and pre-training meta-personalization traits within meta-LoRA modules. Second, to ensure scalability and enable dynamic personalization combination beyond static models, we introduce an Adaptive LoRA Fusion stage. This stage retrieves and dynamically merges the most relevant anchor meta-LoRAs to synthesize a user-specific one, thereby eliminating the need for user-specific storage and supporting more flexible personalization. Third, we propose a LoRA Stacking for Few-Shot Personalization stage, which applies an additional ultra-low-rank, lightweight LoRA module on top of the merged LoRA. Fine-tuning this module enables effective personalization under few-shot settings. Extensive experiments on the LaMP benchmark demonstrate that our approach outperforms existing SOTA methods across multiple tasks.

MTA: A Merge-then-Adapt Framework for Personalized Large Language Model 投稿を読む »

AI, Committee, ニュース, Uncategorized

Generation, Evaluation, and Explanation of Novelists’ Styles with Single-Token Prompts

arXiv:2511.20459v1 Announce Type: new Abstract: Recent advances in large language models have created new opportunities for stylometry, the study of writing styles and authorship. Two challenges, however, remain central: training generative models when no paired data exist, and evaluating stylistic text without relying only on human judgment. In this work, we present a framework for both generating and evaluating sentences in the style of 19th-century novelists. Large language models are fine-tuned with minimal, single-token prompts to produce text in the voices of authors such as Dickens, Austen, Twain, Alcott, and Melville. To assess these generative models, we employ a transformer-based detector trained on authentic sentences, using it both as a classifier and as a tool for stylistic explanation. We complement this with syntactic comparisons and explainable AI methods, including attention-based and gradient-based analyses, to identify the linguistic cues that drive stylistic imitation. Our findings show that the generated text reflects the authors’ distinctive patterns and that AI-based evaluation offers a reliable alternative to human assessment. All artifacts of this work are published online.

Generation, Evaluation, and Explanation of Novelists’ Styles with Single-Token Prompts 投稿を読む »

AI, Committee, ニュース, Uncategorized

OceanBase Releases seekdb: An Open Source AI Native Hybrid Search Database for Multi-model RAG and AI Agents

AI applications rarely deal with one clean table. They mix user profiles, chat logs, JSON metadata, embeddings, and sometimes spatial data. Most teams answer this with a patchwork of an OLTP database, a vector store, and a search engine. OceanBase released seekdb, an open source AI focused database (under the Apache 2.0 license). seekdb is described as an AI native search database that unifies relational data, vector data, text, JSON, and GIS in one engine and exposes hybrid search and in database AI workflows.  What is seekdb? seekdb is positioned as the lightweight, embedded version of the OceanBase engine, aimed at AI applications rather than general purpose distributed deployments. It runs as a single node database, supports embedded mode and client or server mode, and remains compatible with MySQL drivers and SQL syntax. In the capability matrix, seekdb is marked as: Embedded database supported Standalone database supported Distributed database not supported while the full OceanBase product covers the distributed case. From a data model perspective, seekdb supports: Relational data with standard SQL Vector search Full text search JSON data Spatial GIS data all inside one storage and indexing layer. Hybrid search as the core feature The main feature OceanBase pushes is hybrid search. This is search that combines vector based semantic retrieval, full text keyword retrieval, and scalar filters in a single query and a single ranking step. seekdb implements hybrid search through a system package named DBMS_HYBRID_SEARCH with two entry points: DBMS_HYBRID_SEARCH.SEARCH which returns results as JSON, sorted by relevance DBMS_HYBRID_SEARCH.GET_SQL which returns the concrete SQL string used for execution The hybrid search path can run: pure vector search pure full text search combined hybrid search and can push relational filters and joins down into storage. It also supports query reranking strategies like weighted scores and reciprocal rank fusion and can plug in large language model based re-rankers. For retrieval augmented generation (RAG) and agent memory, this means you can write a single SQL query that does semantic matching on embeddings, exact matching on product codes or proper nouns, and relational filtering on user or tenant scopes. Vector and full text engine details At its core, seekdb exposes a modern vector and full text stack. For vectors, seekdb: supports dense vectors and sparse vectors supports Manhattan, Euclidean, inner product, and cosine distance metrics provides in memory index types such as HNSW, HNSW SQ, HNSW BQ provides disk based index types including IVF and IVF PQ Hybrid vector index show how you can store raw text, let seekdb call an embedding model automatically, and have the system maintain the corresponding vector index without a separate preprocessing pipeline. For text, seekdb offers full text search with: keyword, phrase, and Boolean queries BM25 ranking for relevance multiple tokenizer modes The key point is that full text and vector indexes are first class and are integrated in the same query planner as scalar indexes and GIS indexes, so hybrid search does not need external orchestration. AI functions inside the database seekdb includes built in AI function expressions that let you call models directly from SQL, without a separate application service mediating every call. The main functions are: AI_EMBED to convert text into embeddings AI_COMPLETE for text generation using a chat or completion model AI_RERANK to rerank a list of candidatesAI_PROMPT to assemble prompt templates and dynamic values into a JSON object for AI_COMPLETE Model metadata and endpoints are managed by the DBMS_AI_SERVICE package, which lets you register external providers, set URLs, and configure keys, all on the database side.  Multimodal data and workloads seekdb is built to handle multiple data modalities in one node. it has a multimodal data and indexing layer that covers vectors, text, JSON, and GIS, and a multi-model compute layer for hybrid workloads across vector, full text, and scalar conditions. It also provides JSON indexes for metadata queries and GIS indexes for spatial conditions. This allows queries like: find semantically similar documents filter by JSON metadata like tenant, region, or category constrain by spatial range or polygon without leaving the same engine. Because seekdb is derived from the OceanBase engine, it inherits ACID transactions, row and column hybrid storage, and vectorized execution, although high scale distributed deployments remain a job for the full OceanBase database. Comparison Table Key Takeaways AI native hybrid search: seekdb unifies vector search, full text search and relational filtering in a single SQL and DBMS_HYBRID_SEARCH interface, so RAG and agent workloads can run multi signal retrieval in one query instead of stitching together multiple engines. Multimodal data in one engine: seekdb stores and indexes relational data, vectors, text, JSON and GIS in the same engine, which lets AI applications keep documents, embeddings and metadata consistent without maintaining separate databases. In database AI functions for RAG: With AI_EMBED, AI_COMPLETE, AI_RERANK and AI_PROMPT, seekdb can call embedding models, LLMs and rerankers directly from SQL, which simplifies RAG pipelines and moves more orchestration logic into the database layer. Single node, embedded friendly design: seekdb is a single node, MySQL compatible engine that supports embedded and standalone modes, while distributed, large scale deployments remain the role of full OceanBase, which makes seekdb suitable for local, edge and service embedded AI workloads. Open source and tool ecosystem: seekdb is open sourced under Apache 2.0 and integrates with a growing ecosystem of AI tools and frameworks, with Python support via pyseekdb and MCP based integration for code assistants and agents, so it can act as a unified data plane for AI applications. Check out the Repo and Project. Feel free to check out our GitHub Page for Tutorials, Codes and Notebooks. Also, feel free to follow us on Twitter and don’t forget to join our 100k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well. The post OceanBase Releases seekdb: An Open Source AI Native Hybrid Search Database for Multi-model RAG and AI Agents appeared first on MarkTechPost.

OceanBase Releases seekdb: An Open Source AI Native Hybrid Search Database for Multi-model RAG and AI Agents 投稿を読む »

AI, Committee, ニュース, Uncategorized

Online-PVLM: Advancing Personalized VLMs with Online Concept Learning

arXiv:2511.20056v1 Announce Type: new Abstract: Personalized Visual Language Models (VLMs) are gaining increasing attention for their formidable ability in user-specific concepts aligned interactions (e.g., identifying a user’s bike). Existing methods typically require the learning of separate embeddings for each new concept, which fails to support real-time adaptation during testing. This limitation becomes particularly pronounced in large-scale scenarios, where efficient retrieval of concept embeddings is not achievable. To alleviate this gap, we propose Online-PVLM, a framework for online concept learning by leveraging hyperbolic representations. Our approach makes a train-free paradigm for concept embeddings generation at test time, making the use of personalized VLMs both scalable and efficient. In addition, we develop OP-Eval, a comprehensive and large-scale benchmark comprising 1,292 concepts and over 30K high-quality instances with diverse question types, designed to rigorously assess online concept learning in realistic scenarios. Extensive experiments demonstrate the state-of-the-art performance of our proposed framework. Our source code and dataset will be made available.

Online-PVLM: Advancing Personalized VLMs with Online Concept Learning 投稿を読む »

AI, Committee, ニュース, Uncategorized

EfficientXpert: Efficient Domain Adaptation for Large Language Models via Propagation-Aware Pruning

arXiv:2511.19935v1 Announce Type: cross Abstract: The rapid advancement of large language models (LLMs) has increased the demand for domain-specialized variants in areas such as law, healthcare, and finance. However, their large size remains a barrier to deployment in resource-constrained environments, and existing compression methods either generalize poorly across domains or incur high overhead. In this work, we propose textbf{EfficientXpert}, a lightweight domain-pruning framework that combines a propagation-aware pruning criterion (Foresight Mask) with an efficient adapter-update algorithm (Partial Brain Surgeon). Integrated into the LoRA fine-tuning process, EfficientXpert enables a one-step transformation of general pretrained models into sparse, domain-adapted experts. Across health and legal tasks, it retains up to 98% of dense-model performance at 40% sparsity, outperforming state-of-the-art methods. Further analysis reveals substantial domain-dependent structural shifts that degrade the effectiveness of general pruning masks, underscoring the need for adaptive, domain-aware pruning strategies tailored to each domain.

EfficientXpert: Efficient Domain Adaptation for Large Language Models via Propagation-Aware Pruning 投稿を読む »

AI, Committee, ニュース, Uncategorized

How to Implement Functional Components of Transformer and Mini-GPT Model from Scratch Using Tinygrad to Understand Deep Learning Internals

In this tutorial, we explore how to build neural networks from scratch using Tinygrad while remaining fully hands-on with tensors, autograd, attention mechanisms, and transformer architectures. We progressively build every component ourselves, from basic tensor operations to multi-head attention, transformer blocks, and, finally, a working mini-GPT model. Through each stage, we observe how Tinygrad’s simplicity helps us understand what happens under the hood when models train, optimize, and fuse kernels for performance. Check out the FULL CODES here. Copy CodeCopiedUse a different Browser import subprocess, sys, os print(“Installing dependencies…”) subprocess.check_call([“apt-get”, “install”, “-qq”, “clang”], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) subprocess.check_call([sys.executable, “-m”, “pip”, “install”, “-q”, “git+https://github.com/tinygrad/tinygrad.git”]) import numpy as np from tinygrad import Tensor, nn, Device from tinygrad.nn import optim import time print(f” Using device: {Device.DEFAULT}”) print(“=” * 60) print(“n PART 1: Tensor Operations & Autograd”) print(“-” * 60) x = Tensor([[1.0, 2.0], [3.0, 4.0]], requires_grad=True) y = Tensor([[2.0, 0.0], [1.0, 2.0]], requires_grad=True) z = (x @ y).sum() + (x ** 2).mean() z.backward() print(f”x:n{x.numpy()}”) print(f”y:n{y.numpy()}”) print(f”z (scalar): {z.numpy()}”) print(f”∂z/∂x:n{x.grad.numpy()}”) print(f”∂z/∂y:n{y.grad.numpy()}”) We set up Tinygrad in our Colab environment and immediately begin experimenting with tensors and automatic differentiation. We create a small computation graph and observe how gradients flow through matrix operations. As we print the outputs, we gain an intuitive understanding of how Tinygrad handles backpropagation under the hood. Check out the FULL CODES here. Copy CodeCopiedUse a different Browser print(“nn PART 2: Building Custom Layers”) print(“-” * 60) class MultiHeadAttention: def __init__(self, dim, num_heads): self.num_heads = num_heads self.dim = dim self.head_dim = dim // num_heads self.qkv = Tensor.glorot_uniform(dim, 3 * dim) self.out = Tensor.glorot_uniform(dim, dim) def __call__(self, x): B, T, C = x.shape[0], x.shape[1], x.shape[2] qkv = x.reshape(B * T, C).dot(self.qkv).reshape(B, T, 3, self.num_heads, self.head_dim) q, k, v = qkv[:, :, 0], qkv[:, :, 1], qkv[:, :, 2] scale = (self.head_dim ** -0.5) attn = (q @ k.transpose(-2, -1)) * scale attn = attn.softmax(axis=-1) out = (attn @ v).transpose(1, 2).reshape(B, T, C) return out.reshape(B * T, C).dot(self.out).reshape(B, T, C) class TransformerBlock: def __init__(self, dim, num_heads): self.attn = MultiHeadAttention(dim, num_heads) self.ff1 = Tensor.glorot_uniform(dim, 4 * dim) self.ff2 = Tensor.glorot_uniform(4 * dim, dim) self.ln1_w = Tensor.ones(dim) self.ln2_w = Tensor.ones(dim) def __call__(self, x): x = x + self.attn(self._layernorm(x, self.ln1_w)) ff = x.reshape(-1, x.shape[-1]) ff = ff.dot(self.ff1).gelu().dot(self.ff2) x = x + ff.reshape(x.shape) return self._layernorm(x, self.ln2_w) def _layernorm(self, x, w): mean = x.mean(axis=-1, keepdim=True) var = ((x – mean) ** 2).mean(axis=-1, keepdim=True) return w * (x – mean) / (var + 1e-5).sqrt() We design our own multi-head attention module and a transformer block entirely from scratch. We implement the projections, attention scores, softmax, feedforward layers, and layer normalization manually. As we run this code, we see how each component contributes to a transformer layer’s overall behavior. Check out the FULL CODES here. Copy CodeCopiedUse a different Browser print(“n PART 3: Mini-GPT Architecture”) print(“-” * 60) class MiniGPT: def __init__(self, vocab_size=256, dim=128, num_heads=4, num_layers=2, max_len=32): self.vocab_size = vocab_size self.dim = dim self.tok_emb = Tensor.glorot_uniform(vocab_size, dim) self.pos_emb = Tensor.glorot_uniform(max_len, dim) self.blocks = [TransformerBlock(dim, num_heads) for _ in range(num_layers)] self.ln_f = Tensor.ones(dim) self.head = Tensor.glorot_uniform(dim, vocab_size) def __call__(self, idx): B, T = idx.shape[0], idx.shape[1] tok_emb = self.tok_emb[idx.flatten()].reshape(B, T, self.dim) pos_emb = self.pos_emb[:T].reshape(1, T, self.dim) x = tok_emb + pos_emb for block in self.blocks: x = block(x) mean = x.mean(axis=-1, keepdim=True) var = ((x – mean) ** 2).mean(axis=-1, keepdim=True) x = self.ln_f * (x – mean) / (var + 1e-5).sqrt() return x.reshape(B * T, self.dim).dot(self.head).reshape(B, T, self.vocab_size) def get_params(self): params = [self.tok_emb, self.pos_emb, self.ln_f, self.head] for block in self.blocks: params.extend([block.attn.qkv, block.attn.out, block.ff1, block.ff2, block.ln1_w, block.ln2_w]) return params model = MiniGPT(vocab_size=256, dim=64, num_heads=4, num_layers=2, max_len=16) params = model.get_params() total_params = sum(p.numel() for p in params) print(f”Model initialized with {total_params:,} parameters”) We assemble the full MiniGPT architecture using the components built earlier. We embed tokens, add positional information, stack multiple transformer blocks, and project the final outputs back to vocab logits. As we initialize the model, we begin to appreciate how a compact transformer can be built with surprisingly few moving parts. Check out the FULL CODES here. Copy CodeCopiedUse a different Browser print(“nn PART 4: Training Loop”) print(“-” * 60) def gen_data(batch_size, seq_len): x = np.random.randint(0, 256, (batch_size, seq_len)) y = np.roll(x, 1, axis=1) y[:, 0] = x[:, 0] return Tensor(x, dtype=’int32′), Tensor(y, dtype=’int32′) optimizer = optim.Adam(params, lr=0.001) losses = [] print(“Training to predict previous token in sequence…”) with Tensor.train(): for step in range(20): start = time.time() x_batch, y_batch = gen_data(batch_size=16, seq_len=16) logits = model(x_batch) B, T, V = logits.shape[0], logits.shape[1], logits.shape[2] loss = logits.reshape(B * T, V).sparse_categorical_crossentropy(y_batch.reshape(B * T)) optimizer.zero_grad() loss.backward() optimizer.step() losses.append(loss.numpy()) elapsed = time.time() – start if step % 5 == 0: print(f”Step {step:3d} | Loss: {loss.numpy():.4f} | Time: {elapsed*1000:.1f}ms”) print(“nn PART 5: Lazy Evaluation & Kernel Fusion”) print(“-” * 60) N = 512 a = Tensor.randn(N, N) b = Tensor.randn(N, N) print(“Creating computation: (A @ B.T + A).sum()”) lazy_result = (a @ b.T + a).sum() print(“→ No computation done yet (lazy evaluation)”) print(“nCalling .realize() to execute…”) start = time.time() realized = lazy_result.realize() elapsed = time.time() – start print(f”✓ Computed in {elapsed*1000:.2f}ms”) print(f”Result: {realized.numpy():.4f}”) print(“nNote: Operations were fused into optimized kernels!”) We train the MiniGPT model on simple synthetic data and observe the loss decreasing across steps. We also explore Tinygrad’s lazy execution model by creating a fused kernel that executes only when it is realized. As we monitor timings, we understand how kernel fusion improves performance. Check out the FULL CODES here. Copy CodeCopiedUse a different Browser print(“nn PART 6: Custom Operations”) print(“-” * 60) def custom_activation(x): return x * x.sigmoid() x = Tensor([[-2.0, -1.0, 0.0, 1.0, 2.0]], requires_grad=True) y = custom_activation(x) loss = y.sum() loss.backward() print(f”Input: {x.numpy()}”) print(f”Swish(x): {y.numpy()}”) print(f”Gradient: {x.grad.numpy()}”) print(“nn” + “=” * 60) print(” Tutorial Complete!”) print(“=” * 60) print(“”” Key Concepts Covered: 1. Tensor operations with automatic differentiation 2. Custom neural network layers (Attention, Transformer) 3. Building a mini-GPT language model from scratch 4. Training loop with Adam optimizer 5. Lazy evaluation and kernel fusion 6. Custom activation functions “””) We implement a custom activation function and verify that gradients propagate correctly through it. We then print a summary

How to Implement Functional Components of Transformer and Mini-GPT Model from Scratch Using Tinygrad to Understand Deep Learning Internals 投稿を読む »

We use cookies to improve your experience and performance on our website. You can learn more at プライバシーポリシー and manage your privacy settings by clicking Settings.

Privacy Preferences

You can choose your cookie settings by turning on/off each type of cookie as you wish, except for essential cookies.

Allow All
Manage Consent Preferences
  • Always Active

Save
ja