Quizaic — A Generative AI Case Study

Part 1 — Background and Demo

Marc Cohen
Google Cloud - Community
5 min readJun 8, 2024

--

This is the first in a series of articles about a demo application I created called Quizaic (rhymes with mosaic), which uses generative AI to create high quality trivia quizzes and manage the interactive quiz playing experience. In this series we’ll cover the app architecture and design, the technology choices, how we’re using generative AI, how we mitigate hallucinations, and the many lessons we learned along the way.

Here’s a table of contents for the articles in this series:

In this first article, you’ll see where this app came from and how it works.

Before GenAI

Back in August 2016, I got the idea to build an app for creating and playing trivia quizzes. Unfortunately, I never managed to implement this, mostly because of one major challenge:

I couldn’t find a suitable database of trivia questions, which was both voluminous and freely available.

Since then, I’ve discovered some viable sources of quality trivia questions, like https://opentdb.com/, however, I was frustrated by some restrictions inherent in any such static collection:

  • Limited set of topics
  • Limited set of questions and answers
  • Limited format: multiple choice with four answers
  • Limited language support: English only
  • No associated imagery
  • Expanding quiz content requires tedious manual intervention

What I really wanted was what I call infinitrivia an infinite stream of automatically generated quiz topics and associated content in any language, with flexible formats and auto-generated imagery.

Due to those restrictions, my dream app was relegated to the dustbin of project history for many years, until everything changed in 2023…

GenAI arrives

With the emergence of generative AI in 2023, I wondered whether this new tool might be the key to unlocking the “infinitivia” challenge. Some prototyping and experimentation revealed that it was indeed now feasible. Large Language Models enable us to automatically generate high quality, freely usable, AI-generated trivia quizzes with an unlimited set of topics and formats, in any language, with variable difficulty levels and associated imagery. And all of this could be done surprisingly easily, by programming in English. :)

Finally, after seven years, the tool I needed to create “infinitrivia” had arrived! Now I had to figure out how to put it to good use.

Demo

You can read the rest of this article for a description of how the app works, or watch this short guided tour video:

The home page, which you can visit at quizaic.com¹, looks like this:

Along the left hand side (bottom on mobile), you see a navigation bar with five options.

  • Home and About — these provide exactly what they sound like, the main landing page and a description of the app.
  • Browse — examine already created and stored quizzes, which you are free to reuse or remix for your own purposes.
  • Create — generate a new quiz according to your specifications. You can provide a quiz name, select a generator (we’ll have more to say about generators later, but they basically encapsulate a large language model), enter a topic, select a format, number of questions, difficulty level, and language.
  • Play — play a quiz

If you’re not logged in, you’ll notice a “human” icon in the upper right corner of the page. Clicking this icon will walk you through the authentication process.

You only need to authenticate if you want to create, edit, delete, or host a quiz. You can always play a quiz anonymously, without authenticating.

Quizzes are hosted by visiting the Browse page, finding a quiz of interest (you can select a toggle setting to filter your quizzes or view all quizzes) and clicking on the Host button.

This gives you the option to select synchronous or asynchronous mode of operation, and the number of seconds for players to respond to each question.

Synchronous quizzes are played in lockstep where all players see the same question at the same time, and the questions are advanced, when appropriate, by the quiz host. Asynchronous quizzes allow players to respond to questions in their own time, where the player is empowered to advance to the next question when they are ready. Synchronous quizzes are the typical use case, where a group is competing for the best results in real time. A typical use case for an asynchonous quiz would be a teacher providing a homework assignment, where students should have the flexibility to test their knowledge when it best fits their schedule.

You can try the player user experience for yourself by taking this asynchonous quiz for yourself: https://quizaic.com/play/123.

In the rest of this series, we’ll cover the overall architecture of Quizaic, the technology choices we made, how we generate quizzes, how we manage quiz quality and minimize hallucinations, and share the many lessons we learned along the way.

Next Article: Part 2 — Architecture and Technology Choices

¹Quizaic is not an official Google product. It’s a demonstration app to help people understand how to use Generative AI and Google Cloud services in a real world scenario.

--

--

Marc Cohen
Google Cloud - Community

Engineer@Google - My mission is building tools, tutorials, and other educational artifacts to make computing and data science more accessible and inclusive.