iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📖

re:Invent 2025: Lessons Learned from Processing 800GB of AI Data and LLM Prompt Optimization

に公開
2025/12/10

Introduction

By transcribing various overseas lectures into Japanese articles, we aim to make hidden high-quality information more accessible. This project covers the following presentation!

For transcription articles from re:Invent 2025, please check the information gathered in this Spreadsheet.

📖re:Invent 2025: AWS re:Invent 2025 - 800GB of AI data: Lessons from a failed project (DEV345)

In this video, Sandeep, Principal Solutions Architect at AntStack, shares a failed attempt to build an AI system to select the optimal 5-player team for a VALORANT game hackathon. He processed 7,500 game files, totaling 800GB of JSON data, using Amazon Lightsail to create 6 to 10 distinct datasets. Initially, he attempted to use Amazon Bedrock Knowledge Bases and vectorization, but faced issues where the meaning of numerical data was lost. Next, he used function calling and agents, but encountered problems such as cognitive overload, a 25KB Lambda limit, excessive function calls, and frozen LLMs. Although he finally built a multi-stage flow with Step Functions, he missed the submission deadline. Later, he reflects on the lesson that he succeeded by using simple prompts that leverage the LLM's existing knowledge rather than over-instructing it.

https://www.youtube.com/watch?v=9Zu1wqWddrE
Please note that this is an automatically generated article while maintaining the content of the existing lecture as much as possible. Please be aware that there may be typos or incorrect information.

Main Content

Thumbnail 0

Thumbnail 10

The Challenge of the VALORANT Hackathon and Struggling with Massive Data

Hello everyone. My name is Sandeep. Today I will talk about a failure case. So, let's get started. My name is Sandeep. I work as a Principal Solutions Architect at AntStack. At AntStack, we build serverless and AI applications, so you can reach me via any of these handles.

Thumbnail 30

Thumbnail 40

Well, that's how it started. A colleague sent a message to our Slack channel asking if we wanted to take on the challenge of a hackathon. Since it involved gaming, we decided to give it a try. About the game, VALORANT is an online multiplayer game with a team of 5 players. To win a game, you need to win 13 rounds, and there are about 28 agents. These agents are special characters you can select, and each character has different powers. Therefore, when forming a team, it's important to combine these special abilities and provide a strategy.

There are also about 12 maps. Each map varies in the type of location, hiding spots, and the tactics used. So, everything depends on the combination of agents and the type of map being played.

Thumbnail 80

We were provided with a script from the VALORANT team. The task was simply to run that script and data would flow into our system. However, when we ran the script, it took a very long time, and all our laptops crashed. Fortunately, it was in an S3 bucket, so we ran an S3 sync to get all the data into our S3 bucket. And this is what we eventually got.

Thumbnail 100

Thumbnail 130

The data provided to us was about 7,500 game files from the VALORANT team, spread across 3 different leagues or 3 different tournaments, covering 3 years of gameplay. The total size was 100 GB. We wanted to see what was inside these files. So, when we downloaded some of these files to our laptops to try and extract the contents, VS Code crashed again. This was because these files were pure JSON data, ranging from 200 MB to 800 MB.

Thumbnail 170

So we started using Amazon Lightsail. Amazon Lightsail is a user-friendly service that provides all abstracted resources such as Node.js servers and Django servers. What we did was run the uncompressed script on Lightsail and connected to it via remote SSH from VS Code. This gives a great developer experience. It looks like you're working from your laptop, but you're actually running scripts on the server.

Thumbnail 180

Once decompression was complete, the total size was 800 GB. Now, the question is what's inside these files. So what we started doing—it's just a JSON file, right—was splitting them based on available keys. And we found all this information. Everything a player does in the game is recorded in these files. How much ammo they have, how fast they are running, if they are jumping, what their coordinates are, where they landed, who they killed, how many times they were killed, if they used special abilities, and who won the game.

Thumbnail 230

All the information needed for this game is included in these files. As we started segmenting this data, we began recording what was in these files and what metrics we could use to create a 5-player team. One thing we realized immediately is that volume is not equal to data. Despite having 800 GB of data, once we started processing, there was a lot of unnecessary information. So we began to derive some metrics that would help identify the optimal set of players.

Thumbnail 250

Ultimately, we created 6 to 10 different datasets. These were specialized for the characters played, specialized for the maps played, and player characteristics or player statistics. This included cumulative information about a single player. How many games they played, how many kills they got, what their combat score was, and all relevant information regarding these types of metrics.

Thumbnail 280

Thumbnail 290

Thumbnail 300

Attempts at Vectorization and the Limits of Numerical Data

Now, the data is ready. The problem is how to use it. You cannot just put this directly into an LLM. Because, as I said, it is a massive dataset. The LLM won't be able to process this information. So we thought we would try vectorization and started with Amazon Bedrock Knowledge Bases. Knowledge Base is a very easy way to spin up and connect a vector database.

It also comes with a built-in chatbot, so you can easily check vector performance or query performance and fine-tune based on that. The most important thing when using a vector database is the chunking strategy.

Thumbnail 320

First, we started with default chunking. Default chunking basically takes the entire JSON file, splits it into 300-token pieces, and saves them as vector records in the database. For the vector database, we used OpenSearch. This is also a resource that can be created very easily from the Knowledge Base. Each of these saved tokens becomes an individual record in the vector database. But what happened when we did this was that the JSON file containing all the information was split up, and it made absolutely no sense. One player's information overlapped with another player's, and it meant nothing. When we ran queries against this, we got no output.

Thumbnail 370

So we started using something called a no-chunking strategy. Instead of having a single file containing all player information, we split these files. Each player has their own file containing their own metrics, which becomes a vector record in the database. This started yielding good results.

Thumbnail 390

This is the kind of response we got. We used Claude 3.5 to check what kind of response we could get. When we asked something like, "Please create a 5-player team," it would call the vector database to retrieve information. Here, I specifically asked it to retrieve players based on combat score, but this data was not accurate. Even though there were players with better combat scores, it just picked 5 players at random from the list, and this happened every time. And when we asked a general question like "Please create a 5-player team" without specifying a combat score, we never got any valuable results. At that point, we realized this wouldn't work and started investigating why.

Thumbnail 440

This is a sample of the JSON we were storing in these databases. Now, all this information is distributed across various characteristics of the data. There are assists, damage, kills, and games played. Each is a different dimension or characteristic of the data. When we put all this into vector space, all this information gets dispersed, and the relevance of what is happening is lost. We know that assists are things you do yourself, and combat scores are generated by the system, but the vectorization process removes all this context and just saves it as raw data, so it becomes meaningless when you try to retrieve it with a query.

Thumbnail 490

Another problem with vector databases is numerical values. We know that 5, 10, and 15 are multiples of 5, but to an LLM or vector, these are just numbers that happen to be close to each other. For vectors, 5 and 15 might actually be closer, while 10 might be in a completely different dimensional space. So, when you use vectors containing many numbers, their mathematical meaning is lost.

Thumbnail 520

Therefore, you really need to be careful about this part. Now, the next question: since we know vectorization doesn't work well, how do we get the AI to decide on the best players? The simplest method would be to write a Python script to take these 5 metrics, aggregate them, and find the average, right? But that wasn't what we wanted to do. We wanted to ensure the AI understood that there were 10 metrics available and that it needed to use all 10 of these metrics within that space to get the best information. So we experimented with function calling and started implementing it.

Thumbnail 560

Thumbnail 570

Lessons from Function Calling and Prompt Design

Function calling is, in essence, agentic calling. And Bedrock has agent builders. This makes creating agents easy. It's a two-step process. First, you start by giving the agent instructions. Here, we tell the agent how it needs to react based on the type of questions it receives. What we requested was to select the best character for each map—in other words, select a character or agent.

Thumbnail 590

And for each character, select the best player who played them across the league, and narrow it down to 5 players who could function as a team from this information. Then, once we have these 5 players, assign them to each map, and when assigning them, we also tell them which characters they need to play.

This is everything we asked the LLM to do. And finally, we also asked it to create a strategy. In other words, we asked for all this information in one prompt: how these players need to play on each map, who should attack first, who should defend, and who should be the healer.

Thumbnail 630

Thumbnail 640

And another thing we did was use an action group. We created one action group called ES Query. Basically, this places a Lambda function behind the action group. This Lambda function executes queries against the OpenSearch table. All the information and datasets I mentioned earlier are now stored in the OpenSearch database. Bedrock is designed to call the Lambda whenever information is needed. It generates an ES query and sends it to the Lambda. The Lambda then calls OpenSearch with the actual query, retrieves the data, and sends it back to Bedrock.

Thumbnail 670

Well, when we ran this, we got great results. In this example, it wasn't just considering the combat score; it also factored in how many times the inventory was used, how effective the person was, how many entry frags were made—that is, how aggressive the player is—and many other metrics. This is a comprehensive report on how it works and how beautifully it functions. However, it only worked once out of 20 or 30 attempts, which is how many we tried. That's when we realized the problems inherent in this situation.

Thumbnail 710

First, there is cognitive overload. Basically, we were trying to make the LLM do too many things in a single prompt. Everything we saw in the graph was simply too much. It retrieves massive amounts of data. It gets confused about what the player needs to do or which metrics it needs to retrieve from which player.

Thumbnail 730

Another issue we faced was the limit that we couldn't send more than 25KB of data to the Lambda that sends responses back to the LLM. And every time that happened, the LLM execution failed. The next problem was that there were too many function calls. Every time the LLM tried to execute a query against ES, the LLM would try to triage who the player was, leading to over 30 executions. Now, ES queries depend mainly on the type of dataset that exists. When running aggregate queries on top of that, you need to ensure they follow the types of data already saved. Finally, we faced a problem called a frozen LLM. In these cases, the LLM simply stopped. It timed out. There were no function calls, no log traces of anything happening in the LLM, it just stopped executing.

Thumbnail 790

Thumbnail 800

Thumbnail 810

All of this happened just two days before the project submission. We wondered how we could finish this in such a short time. That's when we tried something called a multi-stage flow. We love Step Functions, so we thought about using Step Functions to finish all of this. Instead of one LLM doing everything, we split it into different LLMs and used Step Functions to orchestrate everything. We also used Lambda in between to cache responses and save them to DynamoDB. This was necessary because, in the end, we also needed to build a chatbot that could answer queries like why this player was selected or what the strategy was, and it needed to be able to respond.

Thumbnail 840

Thumbnail 850

It was working fine until everything had to work together. Each of these parts worked wonderfully individually, but the final summarization and the selection of 5 players didn't work. In the end, we couldn't select 5 players, so we couldn't submit it. We tried until the last 10 minutes, and at that point, we gave up.

Thumbnail 860

And while I was preparing for this presentation, I redid the whole thing to take screenshots. I wanted screenshots showing failures, but it never failed once. And I realized there was a very simple logic. That is, you shouldn't tell an LLM what it already knows. The difference between the prompt we used before and the current prompt is just one simple thing. Before, we were telling the LLM how it needed to think, how it needed to select players per map and per character. Our new prompt didn't have any of that information. We just said, "Please create a team for the VALORANT team." And when we passed the OpenSearch schema, the LLM understood from its previous training that VALORANT is a game, that 5 players were required, and that information about which map, what attack style, and what characteristics were needed was already available. What we were doing was retraining the LLM and trying to make it do things that were off-track from its reasoning.

Thumbnail 930

And finally, when I received the Slack message, I thought this would be a simple project. I thought it was a project I could sit down and finish in a weekend, but it wasn't easy at all. That's all from me. Thank you for attending the session. Please let me know if you have any questions.


This article is automatically generated using Amazon Bedrock while maintaining the original video content as much as possible.

Discussion