Bridging Gaps with AI: Empowering Non-Coders like PM to create Matching Algorithm

Karen Hsieh
6 min readMay 19, 2024

--

Learning with ChatGPT

Started from last July

Last July, in a product manager (PM) community, an interesting proposal surfaced. Someone suggested to relaunch the mentorship program, previously paused due to a lack of operational resources. Having been part of the mentorship program before, I was eager to dive back in and volunteer. Little did I know, this journey would lead me to an exciting experiment with AI.

With a team of all PMs, we had no trouble to outline the rules. We divided into 3 squads: platform, marketing, and matching. I was in the platform squad. We had a clear mission: relaunch and keep the mentorship program up and running no matter who operate it. Additionally, we wanted to resolve the most serious problem: the ghost rate.

However, with all PMs but no engineers, implementing a robust system seemed daunting. We knew manual and semi-automated matching were not going to work. That was the reason why the first mentorship program paused. Serving over 1,000 people interested in the mentorship program required a more sophisticated approach.

After evaluation, the tech stack was Coda and a matching algorithm by Python.

The original tech stack

We successfully relaunched the program with hundreds matched and mentorship sessions.

Mentorship results

That was the time I wanted to try ChatGPT, so I fed it the matching code and asked for an explanation. Leveraging GPT to decipher this code and articulate the additional constraints, like ensuring mentors’ years of experience were longer than mentees’, was a game-changer for me!

When the matching squad leader had to step back, I saw an opportunity to learn more about AI-driven matching. I still asked to recruit another person to lead matching in case I couldn’t finish this with AI on time. So, this is actually my side project’s side project!

Developing the Matching Algorithm

I wanted to match every mentor with 1–2 mentees, learn about matching, and have fun 💃.

Using basic prompt engineering practices — creating GPTs, giving context, and working step-by-step — I broke this project into a few steps:

  • Step 1: Data Preparation
  • Step 2: Define Weighting System
  • Step 3: Algorithm Design
  • Step 4: Selecting Top Matches for Each Mentor
  • Step 5: Examine the Matching Results

Even so, I realized I needed to break it into even smaller steps while generating the code.

ChatGPT is good at writing code comments. I read mostly the comments, not the code.

Code generated by ChatGPT

The best thing about working with AI is that I can ask any question at any time, no matter how small or annoying it might seem. For example, in the relaunch, the friend defined the matching score starting from 1,000 as default. Why 1,000? Why not 2,000 or 500?

Through these conversations, I learned there are different weighting systems: rewarding, penalty, and combination. I not only understood the definition of these systems but also the philosophy, use cases, and considerations. I then used my current context as an example to consider which weighting system I should select.

When I saw the visualization image of the offset distribution, I was surprised. I never expected to get an image after executing the Python file. GPT used a Python library, matplotlib, to create a static chart.

Distribution of offset differences

When I couldn’t understand the code comments, sample code generated by ChatGPT was a great help. Another great tip for prompts is: “Explain it to me like I’m 5.” I also requested GPT to make sure the code printed out results at every step so I could check if the process went as expected.

I had a lot of back-and-forth conversations with ChatGPT to get the match score for hundreds of mentors and multiple hundreds of mentees, resulting in over 70K scores.

I thought I was almost at the end. I only needed to pick 2 mentees with the highest scores for each mentor. I was wrong. Many mentees shared the same mentors. That was not the result I wanted.

Different ways of chatting with AI

I learned about bipartite matching not from ChatGPT. It did mention this keyword in one conversation, but I couldn’t understand. I bothered so many engineering friends. Thanks to their support! (Kudos 💜 to Laurence, Kevin, Joseph, and many Taipei dbt friends.) They explained to me what bipartite is, reviewed my code line by line, and taught me there are many ways to implement bipartite matching.

When “Explain it to me like I’m 5” didn’t work, searching for YouTube videos was a great alternative. Some concepts are too hard to understand via text. Trying other AI tools like Perplexity and Gemini was also very helpful.

Laurence explained to me different ways of chatting with AI. This was a great observation! When I digging the matching concept from the outside in, he, as an engineer, started from the core of the matching, making sure the sample code worked, preparing the data in the format of the sample code, and then expanding it to add more requirements.

Different ways of chatting with AI

Which result is better?

I finished the matching code after crossing over so many blocks. The blue one is my result and the orange one is the code written by the friend of the matching squad. These images were generated by ChatGPT as one of the solutions to examine the matching quality.

Matching result comparison

I’m proud that I accomplished all my goals: developing a matching code, learning a lot, and having a joyful experience!

Learn with AI

This journey has been a remarkable learning experience. By leveraging AI, I not only developed a robust matching algorithm but also gained valuable insights and had a lot of fun. The best part is you can select what you want to learn. I did the whole matching code by copying and pasting. I wanted to know how to implement the logic but didn’t want to write Python code from scratch. ChatGPT did the work for me.

Despite the debates around AI, I encourage you to explore and learn with it. You can ask any question, at any time, and tailor your learning experience to your needs. It will be fun! 💃

Next, I’ll refactor the matching program and share it on GitHub: https://github.com/ijac13/matching_withai. This experience has been so rewarding that I’m excited to continue exploring AI’s potential.

I gave a talk on 2024 WiDS Taipei Conference about this article. Here is the slide I shared if you want to know more details.

🤩 I’m happy to hear how you do data or products. Feel free to reach out to me on LinkedIn Karen Hsieh or Twitter @ijac_wei.

🙋🙋‍♀️ Welcome to Ask Me Anything.

--

--