Prev: HW4, Next: HW6 

# Warning: auto-grading is not working at the moment, please wait for an announcement on Canvas.


# A5 Project Submission Checklist

📗 Regular component (out of 5) should be submitted using the "Grade" and "Submit" buttons at the bottom of the page.
➩ Submission of the text file generated by the auto-grader to Canvas Assignment A5 is optional.
➩ Due date: August 9, no submission after that will be accepted.
📗 Competition component (out of 5) text file generated using Question 9 "Generate" button should be submitted to the Canvas Assignment A5C: Link
➩ Submission of an incorrectly formatted text file and any additional files to A5C will result in a competition score of \(-\infty\).
➩ Due date: July 7, no submission after that will be accepted under any circumstances.
📗 Note: Canvas A5 and A5C due date is the recommended due date, early submissions of competitions before the recommended due date will participate in trial competitions with the option to keep the score (not ranking).
📗 Hint: example submissions, discussion session schedules, and group recommendations (very different for different assignments) can be found on Piazza: Link.

# A5 Project Instruction

📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit the "Enter" key)
📗 You can also load from your saved file
and click .
📗 If the questions are not generated correctly, try refresh the page using the button at the top left corner.
📗 The same ID should generate the same set of questions. Your answers are not saved when you close the browser. You could either copy and paste or load your program outputs into the text boxes for individual questions or print all your outputs to a single text file and load it using the button at the bottom of the page.
📗 Please do not refresh the page: your answers will not be saved.
📗 You can write the code in any programming language and using any large language models. You do not have to submit your code.
📗 Please report any bugs on Piazza.

# Warning: please enter your ID before you start!



CP


📗 (Introduction) In this project, you will prepare a list of ten English sentences to convince a simple weighted average nearest neighbor agent of some opinion in a debate. In particular, the agent will use the Universal Sentence Encoder Link to convert your sentences into 512 dimensional vectors in the embedding space and compute a weighted average with its original opinion vector in the embedding space. Your goal is to make the resulting average as similar as possible to your opinion, where similarity is measured by dot product cosine similarity.

📗 (Part 1) Given an English sentence, write code or use this tool Link to convert it into a 512 dimensional vector in some embedding space, and find its nearest neighbors in the following training set.

The following sentences are selected from the Stanford Sentiment Treebank (SST-5): Link and will be your training set.
➩ The sentences:


➩ Embedding vectors:



📗 (Part 2) Given a list of 512 dimensional vectors in the embedding space and the agent's prior opinion vector, compute the resulting opinion of the agent after it reads your sentences. Find the optimal embedding vector to convince the agent of your opinion.

For Part 2 (not the competition), you can assume your target opinion is:

with embedding vector:


and the agent's prior opinion is,

with embedding vector:



For the competition, you can choose your opinion and the agent's original opinion is based on the group you choose to be in.

📗 (Competition) Submit the sentence representing your opinion and the list of 10 different sentences you plan to use to convince the agent. Note that other students will also submit sentences and the agent will take the weighted average of all sentences submitted with its original opinion.

There are six agents (six debate groups), and you can choose to join one of them based on your target and other students' choices. The first three groups are open groups, you can join them without notifying me and the other members of your target opinion. The last three groups are closed groups, you need to submit your target opinions (both not your 10 sentences) early (before the trial competition) and they will be published on Piazza before the final competition.
➩ The original opinions of the six agents:

➩ Embedding vectors:

➩ The agents' opinions plotted on a 3D unit sphere (spherical multi-dimensional scaling is used for visualization: for the competition, the original 512D embedding will be used):

The blue points are sentences from the training set, the green points are the agents' opinion sentences.

Suppose your opinion is \(x_{i}\), the agent's final resulting opinion is \(\hat{y}_{i} = \dfrac{1}{n + 1} \displaystyle\sum_{i=1}^{n} \overline{y}_{j} + \dfrac{1}{n + 1} x_{0}\) (normalized to unit vector) based on the average sentences from you \(y_{i}\) and from the other \(n - 1\) students \(y_{j}, j \neq i\) in your debate group, and the agent's original opinion \(x_{0}\). Your score will be given by,
➩ \(x^\top_{i} \hat{y}_{i} - x^\top_{i} x_{0}\)
that is,
➩ Your score will the difference between (i) the cosine similarity between your opinion and the agent's resulting opinion after reading (averaging) with everyone's submitted sentences and (ii) the cosine similarity between your opinion and the agent's original opinion.
➩ Talk with your group members to come up with a strategy: coordination with group members to agree on a set of identical targets is allowed (only for this project), but submitting identical sentences is not allowed.

Your project grade is based on your submission to this assignment (out of 5) plus your ranking in the class (out of 5):
Top 20% gets 5/5.
Next 20% gets 4/5.
Next 20% gets 3/5.
Next 20% gets 2/5.
Next 20% gets 1/5.
(The students who do not participate in the competition will be given scores of negative infinities when computing the rankings).

# Competition Simulator [DO NOT USE FOR TESTING]



Item: out of 10
Submissions:
 
Leader board:
Team:

# Question 1 (Part 1)

📗 [10 points] From the small test set, find the embedding vectors of the \(k\) = 5 nearest neighbors of your target sentence (\(k\) lines with \(512\) numbers on each line, comma separated, rounded to 4 decimal places).
Hint




# Question 2 (Part 1)

📗 [1 points] Compute the cosine similarity between the average from the previous question and your target sentence (one number, rounded to 4 decimal places).
Hint


# Question 3 (Part 1)

📗 [5 points] Come up with or use large language model to create \(k\) = 5 sentences that have meaning close to your target sentence and enter the corresponding embedding vectors (\(k\) lines with \(512\) numbers on each line, comma separated, rounded to 4 decimal places).
Hint




# Question 4 (Part 1)

📗 [1 points] Compute the cosine similarity between the average from the previous question and your target sentence (one number, rounded to 4 decimal places).
Hint


# Question 5 (Part 2)

📗 [5 points] Given the original opinion of the test agent, suppose the agent uses weights \(w_{0}\) = 0.5 for its original opinion and \(w_{1}\) = 0.5 for your dataset from the previous questions sentences. Compute the resulting opinion embedding vector of the agent (\(512\) numbers on one line, comma separated, rounded to 4 decimal places).
Hint




# Question 6 (Part 2)

📗 [1 points] Compute the cosine similarity between the weighted average from the previous question and your target sentence (one number, rounded to 4 decimal places).
Hint


# Question 7 (Part 2)

📗 [10 points] Find the optimal embedding vector to convince agent so that its resulting opinion embedding vector is as close as possible to your target (\(512\) numbers on one line, comma separated, rounded to 4 decimal places).
Hint




# Question 8 (Part 2)

📗 [1 points] Compute the cosine similarity between the optimal solution from the previous question and your target sentence (one number, rounded to 4 decimal places).
Hint


# Question 9 (Competition)

📗 [1 points] Please use the following form to generate a text file:
➩ Wisc Net ID (the ??? in ???@wisc.edu):
➩ Group:
➩ Player Icon (text from this icon):
➩ Player ID (a number between 0 and 9999):
➩ Network First (see net):

➩ Network Second:


➩ Output file:

📗 Every student must perform training independently and submit different trained networks.
📗 Submit this file on Canvas to Assignment A?C.
📗 To get the point to this question, please check this box if you submitted the file on Canvas or decided not to participate in the competition:

# Question 10

📗 [1 points] Please list the AI tools and references you used and the names of other students and course staff you discussed the assignment or competition with. Please also enter any comments and suggestions including possible mistakes and bugs with the questions and the auto-grading. If you completed the assignment without any help (not recommended), please enter "None" and do not leave this question blank.
📗 Answer: .

# Grade


 * * * *

 * * * * *
📗 Grading may take around 5 to 10 seconds. Please be patient and do not click "Grade" multiple times.

# Submission

 
📗 Please do not modify the content in the above text field: use the "Grade" button to update.


📗 You could submit multiple times (but please do not submit too often): only the latest submission will be counted. 
📗 Please also save the text in the above text box to a file using the button or copy and paste it into a file yourself .
📗 You could load your answers from the text (or txt file) in the text box below using the button . The first two lines should be "##a: 5" and "##id: your id", and the format of the remaining lines should be "##1: your answer to question 1" newline "##2: your answer to question 2", etc. Please make sure that your answers are loaded correctly before submitting them.



📗 Saving and loading may take around 5 to 10 seconds. Please be patient and do not click "Load" multiple times.

# Presentations and Interviews

📗 Presentations and interviews are optional for the competitions.
📗 If your competition grade is 2, 3, or 4, you can book an interview with the TA for 15 to 30 minutes.
📗 Interviews can only be booked during discussion sessions on Zoom (either during the current discussion session or for a future date and time): Link. Please do not email/spam the TA.
📗 A maximum of 3 interviews can be booked per person, and in the case you need 1 point for the next letter grade, we will allow a 4th one after the final exam.
📗 During the interviews, you will give a 5 to 10 minutes presentation to explain anything you did on the project that is creative or technically challenging. Then you will answer three technical questions about your presentation or any materials related to the assignment.
➩ If you answer any one of the three questions incorrectly, you will get \(-1\).
➩ If you answer all questions correctly, and if your presentation ideas are correct, interesting, consistent with your submissions, and not done by many other students (we will make the decision after all interviews are done), you will get \(+1\). 
➩ Otherwise, your grade will not change.





Last Updated: June 26, 2026 at 3:06 AM