How we are teaching AI to learn from its mistakes

Humanizing Tech

Media not available

For years, the gold standard for training artificial intelligence has been to show it how to succeed. Whether it was Google DeepMind’s AlphaGo learning from millions of human professional moves or a robot being trained on motion-tracking data from humans in a maze, the assumption was that AI needs an expert model to mimic.

However, Yongcan Cao, a researcher at The University of Texas at San Antonio, is flipping that logic on its head. He is developing a new way for autonomous systems to learn by focusing not on what goes right, but on what goes wrong.

“Humans take risks and learn from failure,” said Cao, PhD, who holds the Mary Lou Clarke Endowed Distinguished Professorship in the Margie and Bill Klesse College of Engineering and Integrated Design. “Think about a baby learning to walk. They stand up, they fall down, and they learn from that fall. We are looking at how to give that same mechanism to AI.”

Solving the “sparse reward” problem

In the world of reinforcement learning — a type of machine learning where an AI learns through trial and error — researchers often face the “sparse reward” problem. In many complex tasks, an AI agent only receives a “reward” or feedback when it successfully completes a task. If the task is highly complex, the agent might wander aimlessly for millions of attempts without ever stumbling upon a success, meaning it receives no data to learn from. Success becomes a matter of chance, much like the “infinite monkey theorem,” where a monkey idly typing on a typewriter may eventually write something coherent, but it’s unlikely to happen any time soon.

To bridge this gap, engineers traditionally use “expert demonstrations,” where a human or a pre-programmed system shows the AI exactly how to perform the task. While effective, this data is expensive, difficult to collect and sometimes impossible to obtain for training in new or dangerous environments.

Cao’s solution, detailed in recent publications including an award-winning abstract for the 2025 International Conference on Autonomous Agents and Multiagent Systems (AAMAS), is a framework called On-Policy Reinforcement Learning from Failure, or “On-F.”

How On-F differs from standard algorithms

Standard reinforcement learning (RL) is akin to a student taking a final exam without ever receiving feedback on their homework throughout the course; they only find out if they passed or failed at the very end.

The On-F framework introduces a “discriminator,” which acts as a judge. Instead of waiting for a final success, the system constantly compares the AI’s current actions to a database of known failures — data that is “cheap and abundant,” according to Cao.

Through a process called “reward densification,” the AI receives constant, incremental feedback that encourages it to attempt the task in new ways. If its current path looks too much like a previous failure, the discriminator provides a “penalty.” This pushes the AI to try something different, effectively “densifying” the feedback loop so the agent is always learning, even when it hasn’t succeeded yet.

“If you imagine a drone flying a specific flight path and failing to locate a target, you don’t want the drone to retrace the same route or fly just a few feet to the left or right. You’d want the drone to try a significantly new approach, such as changing altitude or switching to a wide-angle view,” Cao explained.

When failure is systematic in this way, “failure alone can be used to learn desirable actions even if we don’t have an expert model,” Cao said. However, he also noted that when models are supplied with a mix of learning from failure and learning from demonstration, “we get even better outcomes.”

Competitive performance and real-world results

The findings suggest that this “fail-forward” approach is more than just a theoretical concept. In simulated environments where digital robots were tasked with learning to stand or walk, the AI models using the On-F framework performed as well as — and in some cases better than — models trained using expensive expert data.

The framework was validated using the Gymnasium simulation suite, specifically on tasks like the “PointMaze,” where an agent must navigate through a labyrinth and reach a target with very limited feedback.

The research is supported by a $502,051 grant from the Office of Naval Research (ONR) as part of a multi-year project aimed at making autonomous systems, such as drones, as fast and efficient at decision-making as humans.

“As humans, we don’t take information at face value; we think critically,” Cao said. “From a robotics side, if a drone is pursuing a target and one path is risky, the system needs to analyze that risk based on what it knows could go wrong.”

How On-F stands to shape industry

The ability to train AI using failure data could have massive implications across several industries. In manufacturing and robotics, it could drastically lower the cost of training new systems because engineers would no longer need to spend hundreds of hours creating “perfect” training scenarios.

In the realm of autonomous vehicles and drones, the technology could lead to more robust navigation systems that are better at avoiding obstacles by recognizing the “signature” of a potential collision before it happens.

Much like how AlphaGo began playing the ancient Chinese game of Go in ways humans had never imagined, Cao hopes that his AI models will also clear hurdles humans have yet to overcome — such as designing seemingly impossible surgeries or manufacturing first-of-its-kind nanotechnology.

“My goal is always to help get the word out and develop more actionable insights,” Cao said. “Personally, I feel this is a very helpful way to enable autonomous systems to learn as efficiently as humans do.”

As Cao’s work with the ONR continues through July 2026, his team at UT San Antonio is exploring next steps, including how to refine these “judging” systems to handle more subjective failures, potentially opening the door for AI that can assist in healthcare, logistics and complex disaster-response scenarios where there is no manual for success, only a history of mistakes to avoid.


Jinjun Xiong (center) meets with faculty from the College of AI, Cyber and Computing.

Building communities through our College of AI, Cyber and computing

Humanizing Tech

Media not available

On mornings when students and faculty travel between UT San Antonio’s Main Campus and its growing downtown footprint, Jinjun Xiong, PhD, founding dean of the College of AI, Cyber and Computing, is thinking about the same journey.

Xiong spends much of his day navigating the road and transitions — between campuses, disciplines and the college’s future — as he works to position it at the center of San Antonio’s growing tech corridor.

As faculty and staff prepare to move into new classrooms and offices in both San Pedro I and San Pedro II this summer, Xiong sees downtown San Antonio as more than just a new address. He views the relocation as an opportunity to place students and faculty at the center of government, business and community partnerships as well as at the heart of the ideas and innovations that are shaping the future of technology.

Working together to establish a vision

Since arriving at the college on March 1, Xiong, who holds the Microsoft President’s Endowed Professorship, has met with faculty and staff for an open dialogue about the transition and his vision for the college.

“The college has a lot of energy,” he said. “It’s a new college, and people feel both excited and nervous about this integration and these new changes. The college faculty and staff are open-minded to the changes. People want to be heard and to have a channel to share their opinions and concerns.”

What he learned from engaging with colleagues reinforced his vision and helped shape the college’s priorities:

  • Completing the downtown transition
  • Strengthening partnerships with UT Health San Antonio
  • Advancing UT San Antonio’s role as a leader in cybersecurity
  • Reimagining how AI and computing can be used in the classroom
  • Growing the college’s reputation and research impact

“The most exciting part is doing things new,” he said, adding that he sees the transition as an opportunity to create something new while helping advance the university’s broader goals as an R1 institution pursuing membership in the Association of American Universities.

Collaborating across disciplines

Xiong also wants to foster a deeper collaboration with UT San Antonio’s academic health center, UT Health San Antonio, by exploring how they can further integrate cybersecurity, applied AI education and computing through transdisciplinary connections. For example, the Department of Statistics and Data Science has launched consulting office hours with the School of Nursing and Graduate School of Biomedical Sciences, while faculty are collaborating with the Joe R. and Teresa Lozano Long School of Medicine and the Kate Marmion School of Public Health.

He said the college is encouraging faculty partnerships that incorporate AI and computing to advance health sciences research and discovery.

“I would like to do this more systematically and more broadly — bringing our experts onto other campuses and colleges to show that we are here to support your mission and build this collaboration,” Xiong said.

Evolving the college’s reach and reputation

Building on UT San Antonio’s strength in cybersecurity, Xiong wants to see the cyber program continue to evolve and become more robust.

“I’d like to see how we can elevate our reputation, our history and our legacy and strength in this area,” he said.

Xiong also wants to shape the future of AI education. He said the college is reevaluating curricula and instructional methods to ensure that students develop meaningful knowledge and skills while learning alongside AI. This effort is part of a broader college initiative to adapt education to a future where AI plays a larger role in the classroom.’

Fostering a connected ecosystem  

Xiong measures success for the college in the lives of three key stakeholders — students, faculty and the San Antonio community.

By strengthening connections with the broader community, Xiong says the college can work together to make a tangible difference for a better San Antonio by supporting local needs and fostering civic engagement.

“I feel like we’re making a difference for the city of San Antonio, with our presence downtown and how we connect to the community,” he said. “We welcome more ideas from the community so that we can do more.”

For students, success means expanding opportunities that prepare them for careers through academic and real-world learning experiences.

At the same time, Xiong recognizes that dedicated faculty are essential to the college’s mission and invests in their development and support so they can thrive in the classroom, in research and in their careers. Resources to recruit leading faculty members are top of mind for Xiong.

“We’d love to grow our college in terms of the number of faculty members so that we can be more prominent on the national and international stage and compete with others,” he said.

Now, as founding dean for the College of AI, Cyber and Computing, Xiong is focusing on building connections with faculty, UT San Antonio leadership and external partners and donors.

“I see a lot that has to be done collaboratively,” he said, adding that promoting student and faculty success will be the driving force behind every decision made as the college grows. “Amazing work is happening here.”


Next generation healthcare at the intersection of AI and patient care

Humanizing Tech

Media not available

For medical student Christopher Mao, the path to medicine didn’t begin in a clinic, but in an engineering lab.

Originally from Sugar Land, Texas, Mao entered The University of Texas at Austin with a passion for math, problem-solving and building things, ultimately pursuing a degree in electrical engineering. As an undergraduate, he worked on a range of biomedical and medical-adjacent technologies, from building EKG systems to experimenting with brain-computer interfaces that used EEG signals to control robotic arms.

For Mao, the work was fascinating, but something was missing.

“I realized I didn’t just want to build the technology,” he said. “I wanted to be involved in patient care.”

From lab bench to bedside

Encouraged by a mentor who bridged both worlds — serving as both an ophthalmologist and engineering professor — he began to see a path forward. Clinical shadowing experiences confirmed that instinct, shifting his focus from the lab bench to the bedside.

When it came time to choose a medical school, the Joe R. and Teresa Lozano Long School of Medicine  stood out not only for its academic offerings, but for its people.

“From the start, it felt welcoming,” he said. “My interviewers were genuinely engaged in my experiences and interests. That made a big difference.”

Advancing clinical insight through AI research

Following his technical background, Mao decided to pursue the school’s MD/MSAI program where he gained hands-on experience with machine learning and its clinical applications.

Under the guidance of his mentor, Ronald Rodriguez, MD, PhD , director of the MD/MSAI program and professor in the Department of Urology, Mao studied renal intravascular tumor extension, or RITE, a rare and aggressive form of kidney cancer in which the tumor spreads into nearby veins. Using gene expression data, bioinformatics and AI, his research identified key molecular differences between RITE tumors and other kidney cancers. The findings could help researchers develop new biomarkers to detect the disease earlier and guide more targeted treatments, ultimately improving care and outcomes for patients.

“This research has been meaningful to me because it showed how AI can be used not only to automate tasks, but also to inform new discoveries and uncover biological patterns that may eventually improve patient care,” Mao said. “It has also helped shape my broader interest in academic medicine and in finding ways to combine AI, clinical research and patient care.”

Contributing to medical education and public health

In addition to his research, Mao co-authored a chapter on “Generative AI in Medical Education” for a textbook, AI in Clinical Practice: Enhancing Medical Education, which is expected to be published later this year by CRC Press/Taylor & Francis. This will be one of the first textbooks focused specifically on how AI may transform medical education.

Mao also got the opportunity to engage in public and environmental health. As president of a student organization focused on climate and health, he led initiatives and later contributed to research on PFAS (per- and polyfluoroalkyl substances, commonly known as “forever chemicals”), examining their presence in water systems and how they accumulate in plants. His team earned recognition in a regional competition for that work.

Finding purpose in internal medicine

During his third-year clinical rotations, Mao kept an open mind, exploring a wide range of specialties. But internal medicine consistently stood out.

One patient interaction in particular helped solidify his decision: working with a patient facing hepatocellular carcinoma alongside complex social and family challenges.

“It showed me that medicine isn’t just about diagnosing,” he said. “It’s about being present, listening and supporting patients through difficult moments.”

That perspective of balancing clinical knowledge with human connection continues to shape his career goals, which include a strong interest in cardiology.

Looking ahead to residency and academic medicine

Mao will remain at UT San Antonio for his residency in internal medicine. As he looks ahead to residency and beyond, he envisions a future in academic medicine, where he can continue exploring the intersection of technology and patient care while mentoring the next generation of physicians.

“I’ve had the chance to pursue a lot of different interests,” he said. “Now I see how they all come together. As I continue training in internal medicine, I remain interested in cardiology and am also curious about areas such as cardio-oncology, where cardiovascular medicine, cancer care and translational research intersect.”