Showing posts with label Andrej Karpathy. Show all posts
Showing posts with label Andrej Karpathy. Show all posts

7.17.2024

Andrej Karpathy Announces AI Education Company: Eureka Labs

Eureka Labs

Andrej Karpathy, a renowned figure in the field of artificial intelligence, has announced the launch of a new venture, Eureka Labs, aimed at revolutionizing education through AI integration. The announcement was made via Karpathy’s Twitter account, highlighting his vision for a new kind of AI-native educational institution.


The Vision of Eureka Labs

Eureka Labs is set to create a transformative educational experience that leverages the latest advancements in generative AI. The core idea is to provide an ideal learning experience by combining the expertise of human teachers with the scalability and support of AI Teaching Assistants. Karpathy envisions a scenario where learning physics could be akin to studying directly under Richard Feynman, with an AI assistant providing personalized guidance and support.

Human experts, despite their deep passion and teaching prowess, are limited by time and availability. AI, however, can scale these capabilities, making high-quality education accessible to everyone, anywhere. This Teacher + AI symbiosis aims to run entire curricula on a common platform, allowing for expansive reach and in-depth learning across numerous subjects.


Introducing LLM101n

The first product from Eureka Labs will be an AI course named LLM101n. This undergraduate-level class will guide students through the process of training their own AI, resembling a smaller version of the AI Teaching Assistant envisioned by Karpathy. The course materials will be available online, and Eureka Labs plans to facilitate both digital and physical cohorts to foster collaborative learning environments.

Currently, the team is focused on building LLM101n, with hopes to eventually expand the course offerings and further integrate AI into education. Karpathy’s announcement hints at a future where AI is a pivotal technology in enhancing human potential and broadening the scope of education.


A Passion Project Turned Full-Time Venture

Andrej Karpathy’s journey in education and AI has spanned nearly two decades, from creating YouTube tutorials on solving Rubik's cubes to initiating the popular CS231n course at Stanford and producing the Zero-to-Hero AI series. His professional career has seen him contribute to academic research at Stanford, develop real-world AI products at Tesla, and engage in AGI research at OpenAI.

Eureka Labs represents the culmination of Karpathy’s dual passions for AI and education. After years of working on related projects part-time, Karpathy is now fully dedicating himself to building Eureka Labs, aiming to make a significant impact on education through AI.


Building in Public

While still in the early stages, Karpathy chose to announce Eureka Labs to the public to foster transparency and community engagement. As the company develops, more information and updates will be shared, inviting others to join in the journey of expanding educational horizons through AI.

For those interested in following Eureka Labs and its developments, more details can be found through Karpathy’s Twitter and the official Eureka Labs account.


Eureka Labs is a promising venture that holds the potential to democratize education, making it more accessible and comprehensive through the innovative use of AI. As Karpathy and his team work towards this vision, the world eagerly awaits the impact of this ambitious project on the future of learning.

6.09.2024

Let’s reproduce GPT-2 (124M)

 


The video ended up so long because it is... comprehensive: we start with empty file and end up with a GPT-2 (124M) model:

  • first we build the GPT-2 network 
  • then we optimize it to train very fast
  • then we set up the training run optimization and hyperparameters by referencing GPT-2 and GPT-3 papers
  • then we bring up model evaluation, and 
  • then cross our fingers and go to sleep. 

In the morning we look through the results and enjoy amusing model generations. Our "overnight" run even gets very close to the GPT-3 (124M) model. This video builds on the Zero To Hero series and at times references previous videos. You could also see this video as building my nanoGPT repo, which by the end is about 90% similar.

Github. The associated GitHub repo contains the full commit history so you can step through all of the code changes in the video, step by step.

https://github.com/karpathy/build-nanogpt


Chapters.

On a high level Section 1 is building up the network, a lot of this might be review. Section 2 is making the training fast. Section 3 is setting up the run. Section 4 is the results. In more detail:

  • 00:00:00 intro: Let’s reproduce GPT-2 (124M)
  • 00:03:39 exploring the GPT-2 (124M) OpenAI checkpoint
  • 00:13:47 SECTION 1: implementing the GPT-2 nn.Module
  • 00:28:08 loading the huggingface/GPT-2 parameters
  • 00:31:00 implementing the forward pass to get logits
  • 00:33:31 sampling init, prefix tokens, tokenization
  • 00:37:02 sampling loop
  • 00:41:47 sample, auto-detect the device
  • 00:45:50 let’s train: data batches (B,T) → logits (B,T,C)
  • 00:52:53 cross entropy loss
  • 00:56:42 optimization loop: overfit a single batch
  • 01:02:00 data loader lite
  • 01:06:14 parameter sharing wte and lm_head
  • 01:13:47 model initialization: std 0.02, residual init
  • 01:22:18 SECTION 2: Let’s make it fast. GPUs, mixed precision, 1000ms
  • 01:28:14 Tensor Cores, timing the code, TF32 precision, 333ms
  • 01:39:38 float16, gradient scalers, bfloat16, 300ms
  • 01:48:15 torch.compile, Python overhead, kernel fusion, 130ms
  • 02:00:18 flash attention, 96ms
  • 02:06:54 nice/ugly numbers. vocab size 50257 → 50304, 93ms
  • 02:14:55 SECTION 3: hyperpamaters, AdamW, gradient clipping
  • 02:21:06 learning rate scheduler: warmup + cosine decay
  • 02:26:21 batch size schedule, weight decay, FusedAdamW, 90ms
  • 02:34:09 gradient accumulation
  • 02:46:52 distributed data parallel (DDP)
  • 03:10:21 datasets used in GPT-2, GPT-3, FineWeb (EDU)
  • 03:23:10 validation data split, validation loss, sampling revive
  • 03:28:23 evaluation: HellaSwag, starting the run
  • 03:43:05 SECTION 4: results in the morning! GPT-2, GPT-3 repro
  • 03:56:21 shoutout to llm.c, equivalent but faster code in raw C/CUDA
  • 03:59:39 summary, phew, build-nanogpt github repo

2.13.2024

The Shifting AI Landscape: Andrej Karpathy's Departure from OpenAI and the Potential for New Beginnings

The AI community was abuzz with the recent announcement from Andrej Karpathy, confirming his departure from OpenAI. Known for his significant contributions to Tesla’s Autopilot and AI initiatives, 

Karpathy's move marks a pivotal point not only for OpenAI but for the broader artificial intelligence industry.

Karpathy's exit is not an isolated event. It closely follows another high-profile departure from OpenAI— that of Ilya Sutskever, who left the company earlier amidst a scandal involving SAM. These exits raise questions about the impact on OpenAI's trajectory and the potential ripple effects in the competitive landscape of AI enterprises.


How it affects OpenAI:

OpenAI has lost two of its high-caliber minds. Karpathy was instrumental in developing Tesla's machine learning and computer vision teams, and his expertise in deep learning and computer vision is irreplaceable. Similarly, Sutskever's departure could lead to a gap in OpenAI's leadership and research direction. While the company is robust with talent, the loss of such pivotal figures could slow down some of OpenAI's ambitious projects or shift its strategic focus.


The Speculations:

Amidst these significant changes, the AI community is rife with speculation. Could Karpathy and Sutskever join forces to create a new company? If they do, they would form a formidable team capable of taking on industry giants like OpenAI, Google, and Microsoft. Their combined expertise and experience could lead to innovative breakthroughs in AI and potentially disrupt the current market dynamics.

Karpathy has always been an advocate for open-source and education in AI, as evidenced by his contributions to the community and his work on AI courses. Sutskever, with his profound research background, could complement Karpathy's practical and educational approach. Together, they could cultivate a company that not only pushes the boundaries of AI technology but also focuses on cultivating talent and open collaboration in the field.


The Future Landscape:

The potential formation of a new AI entity by Karpathy and Sutskever could introduce a new chapter in AI development. Such a company would likely emphasize innovation, openness, and educational outreach, setting a different tone from the profit-driven models of some current tech giants.

Furthermore, this hypothetical company could capitalize on the growing disillusionment with the 'closed garden' approach of some firms. By fostering a collaborative environment and focusing on community-driven development, they could attract top talent and support from the open-source community, creating a strong foundation to compete in the AI arena.


In Summary:

The AI industry is no stranger to change, but the departures of Andrej Karpathy and Ilya Sutskever from OpenAI are particularly noteworthy. As the community watches these developments unfold, one thing is certain: the future of AI is as unpredictable as it is exciting. Whether these shifts will lead to the birth of a new AI powerhouse or a reconfiguration of existing ones, the implications for innovation and competition in the field are immense.