Maximilian Du

maxjdu at stanford dot edu

Google Scholar  /  GitHub  /  CV

Maximilian Du

Hey there! I am an undergraduate researcher at Stanford University. I study computer science, psychology (minor) and creative writing (minor). I work in Chelsea Finn's IRIS lab on robot learning.

I am interested in creating robots that learn difficult skills quickly and take unexpected situations in stride. In past work, I've looked at how robots can learn from diverse data, reason across sensory inputs, and search for the best strategy through online interaction. I am also interested how robotics could take inspiration from behavior and cognitive sciences.

In my free time, I love to write short fiction and creative non-fiction. I'm working on a book that looks at the human-animal relationship through the stories of animal trainers.

Scroll down to see my research, teaching, writing, other projects, and course work. Feeling adventurous? Check these out as well:

Whale Book  /  Other Writing /  Course Notes


Robot Reading a Book

When At First You Don't Succeed: Knowing When to Try Again in Novel Test-Time Scenarios

Maximilian Du, Sasha Khazatsky, Tobias Gerstenberg, Chelsea Finn
Ongoing Project

When faced with a difficult task, a human may try different learned strategies until they discover a successful approach. In this project, we try to create a similar try-retry paradigm for robots. First, I train the robot to remember a set of strategies from expert demonstrations. Then, I train a counterfactual model that compares the robot to a hypothetical expert. If the robot does too poorly, we query it for another strategy. We've seen promising results and we are currently scaling it to harder tasks.

Robot Reading a Book

Behavior Retrieval: Few-Shot Imitation Learning by Querying Unlabeled Datasets

Maximilian Du, Suraj Nair, Dorsa Sadigh, Chelsea Finn
Robotics: Science and Systems 2023

Often, robot data isn't shared across projects because of different task / environment conventions. To get past this problem, we create a data filter that selects points that are relevant for a particular task. To create this data filter, we train a state-action embedding that captures a meaningful notion of task similarity. Then, we select points based on closeness in the embedding space. On a real robot, we were able to leverage a precollected dataset (from another institution) to boost performance by more than 35%.

Website  /  Paper  /  Code

Robot Reading a Book

Play it by Ear: Learning Skills amidst Occlusion through Audio-Visual Imitation Learning

Maximilian Du*, Olivia Lee*, Suraj Nair, Chelsea Finn
Robotics: Science and Systems 2022

For certain robot applications like search & rescue, we need more than vision. Humans and animals consult a combination of senses for decision-making. In this project, we make an analogous robot system that reasons across audio and vision. We learn policies end-to-end from RGB vision and audio from a gripper-mounted microphone. The learned policies can accomplish difficult tasks, like extracting keys from a bag when the keys are not initially visible.

Website  /  Paper  /  Code

Robot Reading a Book

Improving LSTM Neural Networks for Better Short-Term Wind Power Predictions

Maximilian Du
IEEE Renewable Energy and Power Engineering (REPE) 2019

Wind power is a crucial renewable energy source, but it is less stable than conventional energy sources. In this project, I created an autoregressive wind power predictor that can help power grids proactively balance grid loads. I gave the model context from weather stations, which doubled the accuracy of the wind power predictions.

Paper  /  Code

Teaching and Outreach

Robot Reading a Book

Can I Train my Robot like my Dog?

Reinforcement learning in AI has origins in animal training in the 1900's. While much has been abstracted away since then, I take another look at this original connection between CS and psychology. In this 90-minute talk, I explore the interplay between challenges faced in robot labs and dolphin stadiums. We explore behavior cloning, reinforcement techniques, models of learning, and more.

I give this talk twice a year at Stanford Splash, an educational outreach program that serves students in the Bay area, especially students from underrepresented and disadvantaged backgrounds.

Slide Deck Sample  /  Stanford Splash Program

Robot Reading a Book

Section Leading for CS 106A/B

I was a section leader for Stanford's introductory CS106A and intermediate CS106B computer science courses. As a section leader, I hosted weekly sessions to review lecture content in a small group setting. I also hosted office hours, graded homeworks, provided interactive feedback, and helped graded exams.

Section Leading Program

Robot Reading a Book

Mentor for Deep Learning Portal

I will be a mentor for the Deep Learning Portal outreach program starting Fall 2023. The Portal is a program created from the IRIS lab and the Stanford CS department, designed to help disadvantaged students learn AI by providing access to existing online courses and hosting live office hours. I will be helping with office hours, where I will be debugging code and answering conceptual questions.

Deep Learning Portal Program


For research to make a positive impact, we need effective storytelling to give it a voice that speaks with clarity, truthfulness, and nuance. Outside of research papers, I work on short fiction and creative non-fiction. Currently, I'm mostly interested in the human-animal relationship, the immigrant identity, and the construction of trauma. We are distinct among all other animals, not because we have memory, but because we can process these lived experiences to an uncanny depth. I'm interested in how we face the terrible, the untouchable. I'm interested in how we seize our pasts and make it our own. Find my writing here. One of my works has been the recipient of a Stanford Creative Writing Prize.

I'm currently working on a non-fiction book that explores the human-animal relationship through people who work with animals. This work looks at ways we think of animals, ways we think of ourselves. It celebrates the uniqueness of humanity and the simultaneous lure of lives very different than our own. It also includes a new look on the commonly-misrepresented world of whale trainers: people who once rode killer whales in acrobatic shows, demonstrating powerful training techniques, uncanny athleticism, and ultimately, trust.

Selected Projects

Robot Reading a Book

Looking Under the Hood of DetectGPT

CS224N Final Project 2023

As Large Language Models (LLMs) become more advanced, there's a strong push to create effective detection algorithms. In this work, we look at a new detection algorithm originally proposed by Mitchell et al: DetectGPT. We proposed and tested ways of improving DetectGPT by focusing on parts of speech. We also demonstrated that DetectGPT can be partially fooled by an adversarial prompt. Finally, we tested DetectGPT on ChatGPT.


Robot Reading a Book

Sixteen Pixels is (Almost) All You Need: Crafting Parameterized Image Uncrumpling Models

Winning CS231N Final Project 2022

Phone document scans can suffer from distortions from a crinkled document. We created a decrumpling model that will take in an image of a crumpled document and smooth it out. We find that an adversarial paradigm with a small PatchGAN yields the most realistic results with the best quantitative scores as well.

Paper  /  Code

Robot Reading a Book

Thompson Sampling Simulator

CS 109 Winning Final Project 2021

Thompson sampling is one approach to exploration, where you sample from belief distributions and test the samples in the real world. It is one way of balancing exploration and exploitation. In this simulation of Thompson sampling, we visualize ants finding a good location for a nest. We also implement Tandem Running, which allows ants to "persuade" other ants, resulting in faster convergence.


Robot Reading a Book

Media Annotator

This simple Python-based program allows you to use keyboard shortcuts to annotate audio, video, and live events with timestamped comments. The program will export your annotations to copy-and-paste text that you can add to any literature review notes. I rely heavily on this tool to review hours of videos for my book.

Recently, I've also made a book annotator that allows you to make page-specific notes. This allows you digitize your annotations for physical books.


Robot Reading a Book

Coding Basics

As a researcher, I often find that I use the same code many times in different applications. To help, I've been working on a large repository of code basics. It's a collection of code snippets that help with model debugging, plot making, basic PyTorch models, and more.


Robot Reading a Book

Course Notes

I learn the best when I take notes on things. Through my four years at Stanford, I've taken hundreds of pages of notes on topics that range from probability to psychology. They cover all levels of knowledge, from undergraduate introduction to cutting-edge AI algorithms. I'm working on making all of these notes public, and i hope that they can be helpful to some people.

Notes (actively updating)

Selected Coursework

Computer Science

CS 236 Deep Generative Models

CS 224R Deep Reinforcement Learning

CS 234 Reinforcement Learning

CS 224N Natural Language Processing with Deep Learning

CS 330 Deep Multi-task and Meta Learning

CS 231N Deep Learning for Computer Vision

CS 229 Machine Learning

CS 285 Deep Reinforcement Learning (Berkeley, self-study)

CS 161 Design and Analysis of Algorithms

CS 110 Principles of Computer Systems

CS 107E Systems from the Ground Up

CS 106B Programming Abstractions in C++


CS 229M Machine Learning Theory

EE 276 Information Theory

CS 228 Probabilistic Graphical Models

MATH 115 Real Analysis

MATH 113 Linear Algebra and Matrix Theory

MATH 51 Linear Algebra and Multivariable Calculus

CS 109 Probability for Computer Science

CS 103 Mathematical Foundations of Computing


PSYCH 169 Advanced Seminar in Memory

PSYCH 45 Introduction to Learning and Memory

PSYCH 30 Introduction to Perception

PSYCH 50 Cognitive Neuroscience

PSYCH 1 Intro to Psychology

Writing, Literature, & Philosophy

ENGLISH 290 Advanced Fiction

ENGLISH 191 Intermediate Creative Non-Fiction

ENGLISH 190 Intermediate Fiction

ENGLISH 92 Introduction Poetry

ENGLISH 91 Introduction Creative Non-Fiction

PSYCH 118F Literature and the Brain

PHIL 2 Moral Philosophy