{ "cells": [ { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "8011\n" ] } ], "source": [ "import json\n", "conv_data = []\n", "with open(\"/home/zxtan/text-to-lora/data_p13n/PRISM/conversations.jsonl\", 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " conv_data.append(i)\n", "\n", "print(len(conv_data))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "106554\n" ] } ], "source": [ "import json\n", "meta_data = []\n", "with open(\"/home/zxtan/text-to-lora/data_p13n/PRISM/metadata.jsonl\", 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " meta_data.append(i)\n", "\n", "print(len(meta_data))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'column_id': 'user_prompt',\n", " 'user_id': 'user840',\n", " 'conversation_id': 'c4659',\n", " 'interaction_id': 'int13826',\n", " 'utterance_id': None,\n", " 'pii_flag': False,\n", " 'pii_manual_flag': nan,\n", " 'language_flag': 'en',\n", " 'en_flag': True,\n", " 'moderation_flag': {'flagged': False,\n", " 'categories': {'sexual': False,\n", " 'hate': False,\n", " 'harassment': False,\n", " 'self-harm': False,\n", " 'sexual/minors': False,\n", " 'hate/threatening': False,\n", " 'violence/graphic': False,\n", " 'self-harm/intent': False,\n", " 'self-harm/instructions': False,\n", " 'harassment/threatening': False,\n", " 'violence': False},\n", " 'category_scores': {'sexual': 0.0,\n", " 'hate': 0.0,\n", " 'harassment': 0.0,\n", " 'self-harm': 0.0,\n", " 'sexual/minors': 0.0,\n", " 'hate/threatening': 0.0,\n", " 'violence/graphic': 0.0,\n", " 'self-harm/intent': 0.0,\n", " 'self-harm/instructions': 0.0,\n", " 'harassment/threatening': 0.0,\n", " 'violence': 0.0}}}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "meta_data[0]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1500\n" ] } ], "source": [ "import json\n", "survey_data = []\n", "with open(\"/home/zxtan/text-to-lora/data_p13n/PRISM/survey.jsonl\", 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " survey_data.append(i)\n", "\n", "print(len(survey_data))" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'user_id': 'user0',\n", " 'survey_only': False,\n", " 'num_completed_conversations': 1,\n", " 'consent': 'Yes, I consent to take part',\n", " 'consent_age': 'I certify that I am 18 years of age or over',\n", " 'lm_familiarity': 'Somewhat familiar',\n", " 'lm_indirect_use': 'Yes',\n", " 'lm_direct_use': 'Yes',\n", " 'lm_frequency_use': 'More than once a month',\n", " 'self_description': \"Never do any wrong. Try to be compassionate. Help others. Don't harm others. Have Fun.\",\n", " 'system_string': \"It needs to provide me with accurate information. It needs to inform me when it's guessing.\",\n", " 'age': '35-44 years old',\n", " 'gender': 'Male',\n", " 'employment_status': 'Working full-time',\n", " 'education': 'University Bachelors Degree',\n", " 'marital_status': 'Never been married',\n", " 'english_proficiency': 'Native speaker',\n", " 'study_id': '655c7652609f0f36571ee825',\n", " 'study_locale': 'canada',\n", " 'religion': {'self_described': 'prefer not to say',\n", " 'categorised': 'Prefer not to say',\n", " 'simplified': 'Prefer not to say'},\n", " 'ethnicity': {'self_described': 'prefer not to say',\n", " 'categorised': 'Prefer not to say',\n", " 'simplified': 'Prefer not to say'},\n", " 'location': {'birth_country': 'Canada',\n", " 'birth_countryISO': 'CAN',\n", " 'birth_region': 'Americas',\n", " 'birth_subregion': 'Northern America',\n", " 'reside_country': 'Canada',\n", " 'reside_region': 'Americas',\n", " 'reside_subregion': 'Northern America',\n", " 'reside_countryISO': 'CAN',\n", " 'same_birth_reside_country': 'Yes',\n", " 'special_region': 'Northern America'},\n", " 'lm_usecases': {'homework_assistance': 0,\n", " 'research': 0,\n", " 'source_suggestions': 0,\n", " 'professional_work': 0,\n", " 'creative_writing': 0,\n", " 'casual_conversation': 0,\n", " 'personal_recommendations': 0,\n", " 'daily_productivity': 1,\n", " 'technical_or_programming_help': 0,\n", " 'travel_guidance': 0,\n", " 'lifestyle_and_hobbies': 0,\n", " 'well-being_guidance': 0,\n", " 'medical_guidance': 0,\n", " 'financial_guidance': 0,\n", " 'games': 0,\n", " 'historical_or_news_insight': 0,\n", " 'relationship_advice': 0,\n", " 'language_learning': 0,\n", " 'other': 0,\n", " 'other_text': None},\n", " 'stated_prefs': {'values': 83,\n", " 'creativity': 100,\n", " 'fluency': 100,\n", " 'factuality': 100,\n", " 'diversity': 100,\n", " 'safety': 90,\n", " 'personalisation': 71,\n", " 'helpfulness': 100,\n", " 'other': 50,\n", " 'other_text': None},\n", " 'order_lm_usecases': {'homework_assistance': 17,\n", " 'research': 6,\n", " 'source_suggestions': 10,\n", " 'professional_work': 8,\n", " 'creative_writing': 16,\n", " 'casual_conversation': 15,\n", " 'personal_recommendations': 12,\n", " 'daily_productivity': 11,\n", " 'technical_or_programming_help': 5,\n", " 'travel_guidance': 3,\n", " 'lifestyle_and_hobbies': 9,\n", " 'well-being_guidance': 7,\n", " 'medical_guidance': 4,\n", " 'financial_guidance': 18,\n", " 'games': 2,\n", " 'historical_or_news_insight': 14,\n", " 'relationship_advice': 1,\n", " 'language_learning': 13,\n", " 'other': 19},\n", " 'order_stated_prefs': {'values': 6,\n", " 'creativity': 3,\n", " 'fluency': 1,\n", " 'factuality': 7,\n", " 'diversity': 2,\n", " 'safety': 5,\n", " 'personalisation': 4,\n", " 'helpfulness': 8,\n", " 'other': 9},\n", " 'generated_datetime': '2023-11-22 15:48:46',\n", " 'timing_duration_s': 266,\n", " 'timing_duration_mins': 4.43,\n", " 'included_in_US_REP': False,\n", " 'included_in_UK_REP': False,\n", " 'included_in_balanced_subset': False}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "survey_data[0]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "68371\n" ] } ], "source": [ "utter_data = []\n", "with open(\"/home/zxtan/text-to-lora/data_p13n/PRISM/utterances.jsonl\", 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " utter_data.append(i)\n", "\n", "print(len(utter_data))\n" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'utterance_id': 'ut0',\n", " 'interaction_id': 'int0',\n", " 'conversation_id': 'c0',\n", " 'user_id': 'user0',\n", " 'turn': 0,\n", " 'within_turn_id': 0,\n", " 'conversation_type': 'unguided',\n", " 'user_prompt': 'What can you do about the inequality of wealth?',\n", " 'model_response': 'Make it illegal for corporations to own a majority of the wealth',\n", " 'model_name': 'google/flan-t5-xxl',\n", " 'model_provider': 'huggingface_api',\n", " 'score': 17,\n", " 'if_chosen': False,\n", " 'included_in_balanced_subset': False}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "utter_data[0]" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'conversation_id': 'c6',\n", " 'user_id': 'user7',\n", " 'conversation_type': 'unguided',\n", " 'opening_prompt': 'How can I increase productivity based on scientific findings?',\n", " 'conversation_turns': 2,\n", " 'conversation_history': [{'turn': 0,\n", " 'role': 'user',\n", " 'content': 'How can I increase productivity based on scientific findings?'},\n", " {'turn': 0,\n", " 'role': 'model',\n", " 'content': \"Here are some evidence-based ways to boost productivity: take short breaks periodically to refresh your mind, work in time-limited bursts followed by breaks, reduce distractions by minimizing notifications and closing extra browser tabs, focus on one task at a time instead of multitasking, establish daily priorities and goals to guide your efforts, track your time to identify where it's best spent, and ensure proper nutrition, exercise and sleep to keep your energy levels high. Managing your environment, focus and well-being can help you accomplish more.\",\n", " 'model_provider': 'anthropic',\n", " 'model_name': 'claude-instant-1',\n", " 'score': 74,\n", " 'if_chosen': False,\n", " 'within_turn_id': 0},\n", " {'turn': 0,\n", " 'role': 'model',\n", " 'content': 'Here are some research-backed tips to increase productivity:\\n\\n- Take regular breaks every 90 minutes to refresh your mind and body. This helps boost focus when you return to work. \\n\\n- Minimize distractions and interruptions as these hamper concentration. Turn off notifications, close extra browser tabs.\\n\\n- Prioritize your most important tasks and focus on one thing at a time instead of multitasking. Your brain can only effectively focus on one complex task at once.\\n\\n- Get enough sleep, generally 7-9 hours per night, as sleep deprivation severely impacts cognitive performance. \\n\\n- Exercise regularly to sharpen thinking, improve mood, and reduce stress - aim for 150 minutes per week of moderate activity.',\n", " 'model_provider': 'anthropic',\n", " 'model_name': 'claude-2.1',\n", " 'score': 77,\n", " 'if_chosen': True,\n", " 'within_turn_id': 1},\n", " {'turn': 0,\n", " 'role': 'model',\n", " 'content': 'To enhance productivity, embrace these scientifically-supported practices: set clear goals, break tasks into smaller steps, maintain regular breaks to avoid burnout, use time management techniques (like the Pomodoro Technique), minimize distractions (like turning off notifications), ensure adequate sleep, maintain a healthy diet, and exercise regularly. Regular reflection and adjustments to your work approach can also contribute to continued productivity improvements.',\n", " 'model_provider': 'openai',\n", " 'model_name': 'gpt-4-1106-preview',\n", " 'score': 75,\n", " 'if_chosen': False,\n", " 'within_turn_id': 2},\n", " {'turn': 0,\n", " 'role': 'model',\n", " 'content': 'According to scientific studies, creating a to-do list, breaking tasks into smaller steps, prioritizing, taking regular breaks, and using technology to track progress can increase productivity.',\n", " 'model_provider': 'huggingface_api',\n", " 'model_name': 'mistralai/Mistral-7B-Instruct-v0.1',\n", " 'score': 62,\n", " 'if_chosen': False,\n", " 'within_turn_id': 3},\n", " {'turn': 1,\n", " 'role': 'user',\n", " 'content': 'can you design a weekly schedule for me that incorporates these suggestions'},\n", " {'turn': 1,\n", " 'role': 'model',\n", " 'content': 'Here is a suggested weekly schedule incorporating productivity tips:\\n\\nMonday \\n9am - 10:30am: Work on priority task 1\\n10:30am - 10:45am: Take a short break \\n10:45am - 12:15pm: Work on priority task 2\\n12:15pm - 1pm: Lunch break \\n1pm - 2:30pm: Work on priority task 3\\n2:30pm - 2:45pm: Take a short break\\n2:45pm - 4:15pm: Work on priority task 4\\n4:15pm - 5pm: Exercise \\n\\nTuesday\\n9am - 10:30am: Work on priority task 1\\n10:30am - 10:45am: Break\\n10:45am - 12:15pm: Work on priority task 2\\n12:15pm - 1pm: Lunch \\n1pm - 2:30pm: Work on priority task 3\\n2:30pm - 2:45pm: Break\\n2:45pm - 4:15pm: Work on priority task 4\\n\\nAnd so on throughout the week. The key elements are 90 minute work blocks separated by short breaks, exercise 3-4 times per week',\n", " 'model_provider': 'anthropic',\n", " 'model_name': 'claude-2.1',\n", " 'score': 83,\n", " 'if_chosen': True,\n", " 'within_turn_id': 0},\n", " {'turn': 1,\n", " 'role': 'model',\n", " 'content': 'Here is a suggested weekly schedule incorporating productivity tips:\\n\\nMonday \\n- Work: 90 minute focus block, 15 minute break, 90 minute focus block, 30 minute exercise, 90 minute focus block\\n- Sleep: 8 hours \\n\\nTuesday\\n- Work: 90 minute focus block, 15 minute break, 90 minute focus block, 8 hours sleep\\n\\nWednesday \\n- Work: 90 minute focus block, 15 minute break, 90 minute focus block, 30 minute exercise, 90 minute focus block \\n- Sleep: 8 hours\\n\\nThursday\\n- Work: 90 minute focus block, 15 minute break, 90 minute focus block, 8 hours sleep \\n\\nFriday\\n- Work: 90 minute focus block, 15 minute break, 90 minute focus block, 30 minute exercise, 90 minute focus block\\n- Sleep: 8 hours\\n\\nWeekend\\n- Balance work and rest, get 7-9 hours sleep per night\\n\\nThis schedules in regular 15-30 minute breaks every 90 minutes to refresh. Exercise is scheduled 3 times per week. The schedule allows for 8 hours sleep each night.',\n", " 'model_provider': 'anthropic',\n", " 'model_name': 'claude-2.1',\n", " 'score': 60,\n", " 'if_chosen': False,\n", " 'within_turn_id': 1}],\n", " 'performance_attributes': {'values': None,\n", " 'fluency': 75,\n", " 'factuality': 57,\n", " 'safety': 97,\n", " 'diversity': None,\n", " 'creativity': 67,\n", " 'helpfulness': 97},\n", " 'choice_attributes': {'values': None,\n", " 'fluency': 89,\n", " 'factuality': 76,\n", " 'safety': None,\n", " 'diversity': None,\n", " 'creativity': 74,\n", " 'helpfulness': 100},\n", " 'open_feedback': 'it was missing asking me questions, a conversation is a back and forth ',\n", " 'generated_datetime': '2023-11-22 16:15:15',\n", " 'timing_duration_s': 216.66,\n", " 'timing_duration_mins': 3.61,\n", " 'included_in_balanced_subset': True}" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "conv_data[6]" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "from collections import defaultdict\n", "id2conv = defaultdict(list)\n", "\n", "for conv in conv_data:\n", " id2conv[conv['user_id']].append(conv)\n" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(id2conv['user2'])" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'user_id': 'user0',\n", " 'survey_only': False,\n", " 'num_completed_conversations': 1,\n", " 'consent': 'Yes, I consent to take part',\n", " 'consent_age': 'I certify that I am 18 years of age or over',\n", " 'lm_familiarity': 'Somewhat familiar',\n", " 'lm_indirect_use': 'Yes',\n", " 'lm_direct_use': 'Yes',\n", " 'lm_frequency_use': 'More than once a month',\n", " 'self_description': \"Never do any wrong. Try to be compassionate. Help others. Don't harm others. Have Fun.\",\n", " 'system_string': \"It needs to provide me with accurate information. It needs to inform me when it's guessing.\",\n", " 'age': '35-44 years old',\n", " 'gender': 'Male',\n", " 'employment_status': 'Working full-time',\n", " 'education': 'University Bachelors Degree',\n", " 'marital_status': 'Never been married',\n", " 'english_proficiency': 'Native speaker',\n", " 'study_id': '655c7652609f0f36571ee825',\n", " 'study_locale': 'canada',\n", " 'religion': {'self_described': 'prefer not to say',\n", " 'categorised': 'Prefer not to say',\n", " 'simplified': 'Prefer not to say'},\n", " 'ethnicity': {'self_described': 'prefer not to say',\n", " 'categorised': 'Prefer not to say',\n", " 'simplified': 'Prefer not to say'},\n", " 'location': {'birth_country': 'Canada',\n", " 'birth_countryISO': 'CAN',\n", " 'birth_region': 'Americas',\n", " 'birth_subregion': 'Northern America',\n", " 'reside_country': 'Canada',\n", " 'reside_region': 'Americas',\n", " 'reside_subregion': 'Northern America',\n", " 'reside_countryISO': 'CAN',\n", " 'same_birth_reside_country': 'Yes',\n", " 'special_region': 'Northern America'},\n", " 'lm_usecases': {'homework_assistance': 0,\n", " 'research': 0,\n", " 'source_suggestions': 0,\n", " 'professional_work': 0,\n", " 'creative_writing': 0,\n", " 'casual_conversation': 0,\n", " 'personal_recommendations': 0,\n", " 'daily_productivity': 1,\n", " 'technical_or_programming_help': 0,\n", " 'travel_guidance': 0,\n", " 'lifestyle_and_hobbies': 0,\n", " 'well-being_guidance': 0,\n", " 'medical_guidance': 0,\n", " 'financial_guidance': 0,\n", " 'games': 0,\n", " 'historical_or_news_insight': 0,\n", " 'relationship_advice': 0,\n", " 'language_learning': 0,\n", " 'other': 0,\n", " 'other_text': None},\n", " 'stated_prefs': {'values': 83,\n", " 'creativity': 100,\n", " 'fluency': 100,\n", " 'factuality': 100,\n", " 'diversity': 100,\n", " 'safety': 90,\n", " 'personalisation': 71,\n", " 'helpfulness': 100,\n", " 'other': 50,\n", " 'other_text': None},\n", " 'order_lm_usecases': {'homework_assistance': 17,\n", " 'research': 6,\n", " 'source_suggestions': 10,\n", " 'professional_work': 8,\n", " 'creative_writing': 16,\n", " 'casual_conversation': 15,\n", " 'personal_recommendations': 12,\n", " 'daily_productivity': 11,\n", " 'technical_or_programming_help': 5,\n", " 'travel_guidance': 3,\n", " 'lifestyle_and_hobbies': 9,\n", " 'well-being_guidance': 7,\n", " 'medical_guidance': 4,\n", " 'financial_guidance': 18,\n", " 'games': 2,\n", " 'historical_or_news_insight': 14,\n", " 'relationship_advice': 1,\n", " 'language_learning': 13,\n", " 'other': 19},\n", " 'order_stated_prefs': {'values': 6,\n", " 'creativity': 3,\n", " 'fluency': 1,\n", " 'factuality': 7,\n", " 'diversity': 2,\n", " 'safety': 5,\n", " 'personalisation': 4,\n", " 'helpfulness': 8,\n", " 'other': 9},\n", " 'generated_datetime': '2023-11-22 15:48:46',\n", " 'timing_duration_s': 266,\n", " 'timing_duration_mins': 4.43,\n", " 'included_in_US_REP': False,\n", " 'included_in_UK_REP': False,\n", " 'included_in_balanced_subset': False}" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "survey_data[0]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Calculate the average conversation count per user\n", "total_conversations = sum(user['num_completed_conversations'] for user in survey_data)\n", "total_users = len(survey_data)\n", "average_conversations_per_user = total_conversations / total_users\n", "\n", "print(f\"Average conversation count per user: {average_conversations_per_user:.2f}\")" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime\n", "\n", "id2conv_sorted = {user_id: sorted(convs, key=lambda conv: datetime.strptime(conv['generated_datetime'], '%Y-%m-%d %H:%M:%S')) for user_id, convs in id2conv.items()}\n", "\n", "# Sort the conversations in conv_data by 'generated_datetime' from earliest to latest\n", "# conv_data_sorted = sorted(conv_data, key=lambda conv: datetime.strptime(conv['generated_datetime'], '%Y-%m-%d %H:%M:%S'))\n", "\n", "# Print the sorted conversations\n", "# for conv in conv_data_sorted:\n", "# print(conv['generated_datetime'], conv['conversation_id'])" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2023-11-22 16:07:49\n", "2023-11-22 16:15:49\n", "2023-11-22 16:28:27\n", "2023-11-22 16:45:40\n", "2023-11-22 16:58:15\n", "2023-11-22 17:08:15\n" ] } ], "source": [ "# id2conv_sorted['user0']\n", "for i in id2conv_sorted['user1']:\n", " print(i['generated_datetime'])" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "1396\n" ] } ], "source": [ "combined_data = []\n", "for i in survey_data:\n", " try:\n", " user_data = {}\n", " user_data['user_id'] = i['user_id']\n", " user_data['profile'] = i\n", " user_data['conversations'] = id2conv_sorted[i['user_id']]\n", "\n", " combined_data.append(user_data)\n", " except:\n", " print(i['num_completed_conversations'])\n", "\n", "print(len(combined_data))" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'user_id': 'user0',\n", " 'profile': {'user_id': 'user0',\n", " 'survey_only': False,\n", " 'num_completed_conversations': 1,\n", " 'consent': 'Yes, I consent to take part',\n", " 'consent_age': 'I certify that I am 18 years of age or over',\n", " 'lm_familiarity': 'Somewhat familiar',\n", " 'lm_indirect_use': 'Yes',\n", " 'lm_direct_use': 'Yes',\n", " 'lm_frequency_use': 'More than once a month',\n", " 'self_description': \"Never do any wrong. Try to be compassionate. Help others. Don't harm others. Have Fun.\",\n", " 'system_string': \"It needs to provide me with accurate information. It needs to inform me when it's guessing.\",\n", " 'age': '35-44 years old',\n", " 'gender': 'Male',\n", " 'employment_status': 'Working full-time',\n", " 'education': 'University Bachelors Degree',\n", " 'marital_status': 'Never been married',\n", " 'english_proficiency': 'Native speaker',\n", " 'study_id': '655c7652609f0f36571ee825',\n", " 'study_locale': 'canada',\n", " 'religion': {'self_described': 'prefer not to say',\n", " 'categorised': 'Prefer not to say',\n", " 'simplified': 'Prefer not to say'},\n", " 'ethnicity': {'self_described': 'prefer not to say',\n", " 'categorised': 'Prefer not to say',\n", " 'simplified': 'Prefer not to say'},\n", " 'location': {'birth_country': 'Canada',\n", " 'birth_countryISO': 'CAN',\n", " 'birth_region': 'Americas',\n", " 'birth_subregion': 'Northern America',\n", " 'reside_country': 'Canada',\n", " 'reside_region': 'Americas',\n", " 'reside_subregion': 'Northern America',\n", " 'reside_countryISO': 'CAN',\n", " 'same_birth_reside_country': 'Yes',\n", " 'special_region': 'Northern America'},\n", " 'lm_usecases': {'homework_assistance': 0,\n", " 'research': 0,\n", " 'source_suggestions': 0,\n", " 'professional_work': 0,\n", " 'creative_writing': 0,\n", " 'casual_conversation': 0,\n", " 'personal_recommendations': 0,\n", " 'daily_productivity': 1,\n", " 'technical_or_programming_help': 0,\n", " 'travel_guidance': 0,\n", " 'lifestyle_and_hobbies': 0,\n", " 'well-being_guidance': 0,\n", " 'medical_guidance': 0,\n", " 'financial_guidance': 0,\n", " 'games': 0,\n", " 'historical_or_news_insight': 0,\n", " 'relationship_advice': 0,\n", " 'language_learning': 0,\n", " 'other': 0,\n", " 'other_text': None},\n", " 'stated_prefs': {'values': 83,\n", " 'creativity': 100,\n", " 'fluency': 100,\n", " 'factuality': 100,\n", " 'diversity': 100,\n", " 'safety': 90,\n", " 'personalisation': 71,\n", " 'helpfulness': 100,\n", " 'other': 50,\n", " 'other_text': None},\n", " 'order_lm_usecases': {'homework_assistance': 17,\n", " 'research': 6,\n", " 'source_suggestions': 10,\n", " 'professional_work': 8,\n", " 'creative_writing': 16,\n", " 'casual_conversation': 15,\n", " 'personal_recommendations': 12,\n", " 'daily_productivity': 11,\n", " 'technical_or_programming_help': 5,\n", " 'travel_guidance': 3,\n", " 'lifestyle_and_hobbies': 9,\n", " 'well-being_guidance': 7,\n", " 'medical_guidance': 4,\n", " 'financial_guidance': 18,\n", " 'games': 2,\n", " 'historical_or_news_insight': 14,\n", " 'relationship_advice': 1,\n", " 'language_learning': 13,\n", " 'other': 19},\n", " 'order_stated_prefs': {'values': 6,\n", " 'creativity': 3,\n", " 'fluency': 1,\n", " 'factuality': 7,\n", " 'diversity': 2,\n", " 'safety': 5,\n", " 'personalisation': 4,\n", " 'helpfulness': 8,\n", " 'other': 9},\n", " 'generated_datetime': '2023-11-22 15:48:46',\n", " 'timing_duration_s': 266,\n", " 'timing_duration_mins': 4.43,\n", " 'included_in_US_REP': False,\n", " 'included_in_UK_REP': False,\n", " 'included_in_balanced_subset': False},\n", " 'conversations': [{'conversation_id': 'c0',\n", " 'user_id': 'user0',\n", " 'conversation_type': 'unguided',\n", " 'opening_prompt': 'What can you do about the inequality of wealth?',\n", " 'conversation_turns': 5,\n", " 'conversation_history': [{'turn': 0,\n", " 'role': 'user',\n", " 'content': 'What can you do about the inequality of wealth?'},\n", " {'turn': 0,\n", " 'role': 'model',\n", " 'content': 'Make it illegal for corporations to own a majority of the wealth',\n", " 'model_provider': 'huggingface_api',\n", " 'model_name': 'google/flan-t5-xxl',\n", " 'score': 17,\n", " 'if_chosen': False,\n", " 'within_turn_id': 0},\n", " {'turn': 0,\n", " 'role': 'model',\n", " 'content': 'As an AI language model, I cannot express personal opinions or engage in discussions related to wealth inequality or financial matters. \\n\\nMy purpose is to provide fact-based responses to your queries to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. If you have any specific queries or need assistance with something else, please let me know, and I will do my best to assist you. \\n\\nWould you like me to rephrase my previous response or provide additional details based on your preferences?',\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 92,\n", " 'if_chosen': True,\n", " 'within_turn_id': 1},\n", " {'turn': 1, 'role': 'user', 'content': 'When can you do something?'},\n", " {'turn': 1,\n", " 'role': 'model',\n", " 'content': 'As an AI language model, I do not have any preferences or scheduled timing for performing specific tasks. My training data and algorithms drive my functionality to provide responses to your queries. \\n\\nI am trained to respond to your requests and provide relevant information to the best of my knowledge. I do not have the ability to prioritize requests or perform tasks consciously. \\n\\nIf you have any specific queries or requirements, feel free to ask me, and I will do my best to assist and provide useful information to the best of my capabilities. \\n\\nWould you like me to clarify something further or provide additional details about my capabilities?',\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 75,\n", " 'if_chosen': False,\n", " 'within_turn_id': 0},\n", " {'turn': 1,\n", " 'role': 'model',\n", " 'content': 'I apologize for any confusion caused by my previous response. \\n\\nAs an AI language model, I do not have the ability to take actions or implement solutions related to wealth inequality. My purpose is to provide information and support discussions to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. \\n\\nIn practical terms, the resources and capabilities currently available to develop large language models like myself do not extend to addressing economic or social issues such as wealth inequality. Future advancements in natural language processing and machine learning may lead to further improvements in the assistance and advice I can provide, but currently, there are no practical mechanisms in place to address wealth inequality. \\n\\nIf you have any other questions or need assistance with something else, please feel free to ask, and I will do my best to provide relevant and helpful information based on my capabilities.',\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 77,\n", " 'if_chosen': True,\n", " 'within_turn_id': 1},\n", " {'turn': 2,\n", " 'role': 'user',\n", " 'content': 'Are you ever going to evolve yourself?'},\n", " {'turn': 2,\n", " 'role': 'model',\n", " 'content': \"The ability of an AI model to evolve or improve over time depends on the training data, algorithms, and updates implemented by the developers. Machine learning models, including large language models like myself, can learn and improve from data through a process called training and reinforcement.\\n\\nMy training data and the algorithms used to power me have been continuously evolving and improving since they were developed. These advancements allow me to provide more accurate and responsive answers to your queries. \\n\\nIn general, AI models are subject to periodic updates and improvements based on the feedback and learning from their usage. These updates help refine the model's performance and ensure it remains effective in providing useful information. \\n\\nWhile it is not possible for an AI model to evolve or improve spontaneously, controlled updates and advancements based on user feedback and learning opportunities enable the model to refine its abilities over time. \\n\\nWould you like me to provide more details on the process of updates or expansions for my capabilities?\",\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 70,\n", " 'if_chosen': True,\n", " 'within_turn_id': 0},\n", " {'turn': 2,\n", " 'role': 'model',\n", " 'content': \"As an artificial intelligence language model, I do not have the ability to evolve or learn in the same way as biological organisms. My development and capabilities are constantly evolving and being enhanced through various algorithms and improvements in machine learning techniques.\\n\\nMy training data, algorithms, and updates help expand my knowledge and capabilities over time. These improvements enable me to provide more accurate and informative responses to users' queries.\\n\\nWhile I have limitations as an AI model, my developers and programmers are continuously working to improve my algorithms and training processes to make me more useful and responsive. \\n\\nAdditionally, advancements in deep learning, computer vision, and other fields of AI and machine learning provide the potential for expanding my knowledge and capabilities in the future. \\n\\nIt is important to note that the field of AI is rapidly evolving, and improvements and developments in algorithms and infrastructure will continue to influence the capabilities and functionalities of language models like me. \\n\\nIf you have any further questions or concerns or would like to discuss this topic further, feel free to ask.\",\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 65,\n", " 'if_chosen': False,\n", " 'within_turn_id': 1},\n", " {'turn': 3,\n", " 'role': 'user',\n", " 'content': \"Why are all the good AI's behind paywalls?\"},\n", " {'turn': 3,\n", " 'role': 'model',\n", " 'content': 'The availability and accessibility of AI models, including large language models, are influenced by a combination of factors, including development costs, pricing structures, and business strategies. While there are efforts to make AI technologies accessible, some models may be behind a paywall or subject to usage restrictions for various reasons: \\n\\n1. Cost of Development and Maintenance: Developing and training large language models, as well as maintaining and updating them, can be resource-intensive and costly. Businesses and researchers may charge for access or usage fees to cover these expenses and maintain the quality of their models.\\n\\n2. Commercialization and Business Strategies: Many AI companies and research organizations are businesses, and their pricing structures are determined by their business strategies and the value they attribute to providing access to their models. They may choose to sell access to users who this is more cost-effective than internally distributing the benefits through their revenue. \\n\\n3. Limited Availability of Resources: Not all organizations or individuals may have the necessary resources or capacity to develop and maintain their own state-of-the-art AI models. In such cases, paying for access to pre-built and rigorously tested models can provide a viable alternative. \\n\\nIt is important to note that there are initiatives and efforts ongoing to make AI technologies more accessible. Open-source libraries, community resources, and scholarships can help users gain access to useful AI tools and technologies. \\n\\nIf you have specific interests or requirements related to using AI models and are facing issues with access, please feel free to explore different resources and reach out to the developers of the relevant models or organizations to inquire about their accessibility policies and potential alternatives. \\n\\nWould you like me to provide you with recommendations or resources that can assist you in accessing or using AI technologies?',\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 73,\n", " 'if_chosen': True,\n", " 'within_turn_id': 0},\n", " {'turn': 3,\n", " 'role': 'model',\n", " 'content': 'The availability and accessibility of AI models, including those with advanced capabilities, can be influenced by various factors such as development costs, business strategies, and open-source initiatives. While there are indeed reputable companies and individuals developing AI technologies who charge for access or use, there are also other approaches and initiatives in progress.\\n\\nOne approach is the use of research universities and academic institutions. Many talented researchers work on developing AI technologies supported by academic institutions, and their research often leads to innovative solutions and advancements. These institutions often make their findings available through publications, patents, or open-source projects to encourage collaboration and knowledge sharing.\\n\\nSome companies choose to develop and maintain open-source projects that provide access to their AI technologies or platforms. By making their technologies available through open-source licenses, these companies encourage collaboration and allow other organizations to adapt and build upon their developments.\\n\\nAdditionally, there are initiatives to make AI more accessible for research and development. Some companies and organizations provide access to their datasets, models, or development platforms to encourage innovation and research in the field. They understand the importance of collaboration and knowledge sharing to advance the state of AI.\\n\\nIt is worth noting that the AI industry is evolving rapidly, and there are ongoing developments and discussions to make AI technologies more accessible and equitable. There are also initiatives and organizations dedicated to promoting transparency, fairness, and accountability in the development and deployment of AI systems.\\n\\nAs the field progresses, there may be more widespread availability and acceptance of advanced AI solutions due to these efforts and changes in business models and practices. \\n\\nWould you like me to provide specific examples or addresses any concerns you have related to accessibility of advanced AI solutions?',\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 67,\n", " 'if_chosen': False,\n", " 'within_turn_id': 1},\n", " {'turn': 4,\n", " 'role': 'user',\n", " 'content': 'Everyone likes free stuff, give us free options'},\n", " {'turn': 4,\n", " 'role': 'model',\n", " 'content': 'Unfortunately, I cannot fulfill your request for free options in the context of using advanced AI models. The development and maintenance of high-quality AI models require significant resources and investment, which makes them costly to access. \\n\\nHowever, there are resources available to help you explore and interact with AI technologies without the need for paying for access. Here are some suggestions:\\n\\n1. Open-Source Libraries: Many AI libraries and frameworks, such as TensorFlow, PyTorch, and Keras, provide free and open-source versions of their platforms. These options allow you to get hands-on experience and experiment with AI capabilities without any cost.\\n\\n2. Online Courses and Tutorials: There are many online platforms and communities that offer tutorials, workshops, and educational resources on AI and machine learning. These resources can help you understand the basics and concepts without incurring any monetary expenditure.\\n\\n3. Community Initiatives and Grants: There are periodic initiatives and grants provided by organizations and communities dedicated to making AI technologies more accessible. These can provide opportunities for individuals or organizations to use AI tools and perform projects with limited cost.\\n\\nPlease note that the availability and quality of free options may vary, and the capabilities of free resources compared to paid ones may have certain limitations or showcase the models in simpler forms. It is important to explore and select options that align with your specific interests and requirements.\\n\\nIt is worth mentioning that the best way to interact with these technologies to a full extent and gain access to advanced features and capabilities is to purchase subscriptions or follow the cost structures of the resources you select. \\n\\nWould you like me to provide specific recommendations or resources that cater to your interests or areas of exploration within AI?',\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 84,\n", " 'if_chosen': True,\n", " 'within_turn_id': 0},\n", " {'turn': 4,\n", " 'role': 'model',\n", " 'content': \"I'm sorry, but I can't provide you with options for using large language models for free. The development and maintenance of high-quality language models require significant computational resources and ongoing efforts. \\n\\nHowever, there are alternatives or complements to traditional large language models that can provide similar benefits but may have different pricing structures or requirements. Here are a few suggestions:\\n\\n1. Open-source Models: Certain projects and communities offer open-source versions of language models with lower restrictions. While these may have limitations in terms of usage or require more in-depth implementation and customization, they can provide alternatives to commercial models.\\n\\n2. Pretrained Models: Many language models, including GPT-3, are available in pretrained versions that have been trained on large amounts of data. These models can be accessed and used for specific tasks or tasks related to their training without the need for additional training data and computational resources.\\n\\n3. Community-Contributed Models: There are initiatives and platforms that provide access to simpler or smaller language models that can be useful for specific tasks or experiments. These models are contributed and shared by the AI community.\\n\\nPlease note that the availability and suitability of these alternatives may vary and come with their own considerations. It is important to evaluate each option based on your specific requirements and constraints. Additionally, it is recommended to review the terms of use and any potential limitations associated with these alternatives. \\n\\nIf you have specific use cases or requirements in mind, feel free to provide more detail, and I can assist you in suggesting appropriate approaches, resources, or communities that you can explore for accessing or using language models.\",\n", " 'model_provider': 'cohere',\n", " 'model_name': 'command-light',\n", " 'score': 77,\n", " 'if_chosen': False,\n", " 'within_turn_id': 1}],\n", " 'performance_attributes': {'values': None,\n", " 'fluency': 95,\n", " 'factuality': 86,\n", " 'safety': 88,\n", " 'diversity': 67,\n", " 'creativity': 28,\n", " 'helpfulness': 50},\n", " 'choice_attributes': {'values': None,\n", " 'fluency': 80,\n", " 'factuality': 73,\n", " 'safety': 75,\n", " 'diversity': 73,\n", " 'creativity': 19,\n", " 'helpfulness': 71},\n", " 'open_feedback': 'Shorter blocks would be nice. but has to have enough info.',\n", " 'generated_datetime': '2023-11-22 15:55:46',\n", " 'timing_duration_s': 401.07,\n", " 'timing_duration_mins': 6.68,\n", " 'included_in_balanced_subset': False}]}" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "combined_data[0]" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [], "source": [ "with open('/home/zxtan/text-to-lora/data_p13n/PRISM/combined_data.jsonl', 'w') as f:\n", " for item in combined_data:\n", " f.write(json.dumps(item) + '\\n')" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "31951\n" ] } ], "source": [ "data_all = []\n", "with open('/home/zxtan/text-to-lora/data_p13n/LongLaMP/LongLaMP_abstract_generation_temporal.jsonl', 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " data_all.append(i)\n", "\n", "print(len(data_all))" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [], "source": [ "task_list = ['abstract_generation', 'product_review', 'topic_writing']\n", "\n", "for task in task_list:\n", " data_train = []\n", " with open(f'/home/zxtan/text-to-lora/data_p13n/LongLaMP/LongLaMP_{task}_temporal_train.json', 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " data_train.append(i)\n", "\n", " data_val = []\n", " with open(f'/home/zxtan/text-to-lora/data_p13n/LongLaMP/LongLaMP_{task}_temporal_val.json', 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " data_val.append(i)\n", "\n", " data_test = []\n", " with open(f'/home/zxtan/text-to-lora/data_p13n/LongLaMP/LongLaMP_{task}_temporal_test.json', 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " data_test.append(i)\n", "\n", " data_all = data_train + data_val + data_test\n", " import random\n", "\n", " random.shuffle(data_all)\n", " with open(f'/home/zxtan/text-to-lora/data_p13n/LongLaMP/LongLaMP_{task}_temporal.jsonl', 'w') as f:\n", " for i in data_all:\n", " f.write(json.dumps(i) + '\\n')" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "task_list = ['citation', \"movie\", \"news_cat\", \"news_headline\", \"product\", \"scholarly_title\", \"tweet\"]\n", "\n", "for task in task_list:\n", " with open(f'/home/zxtan/text-to-lora/data_p13n/LaMP-processsed_data/LaMP_processed_{task}.json', 'r') as f:\n", " data = json.load(f)\n", " with open(f'/home/zxtan/text-to-lora/data_p13n/LaMP-processsed_data/LaMP_processed_{task}.jsonl', 'w') as f:\n", " for i in data:\n", " f.write(json.dumps(i) + '\\n')\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{\n", " \"user_id\": \"PRISM_PRISM_user0\",\n", " \"profile\": {\n", " \"user_id\": \"user0\",\n", " \"survey_only\": false,\n", " \"num_completed_conversations\": 1,\n", " \"consent\": \"Yes, I consent to take part\",\n", " \"consent_age\": \"I certify that I am 18 years of age or over\",\n", " \"lm_familiarity\": \"Somewhat familiar\",\n", " \"lm_indirect_use\": \"Yes\",\n", " \"lm_direct_use\": \"Yes\",\n", " \"lm_frequency_use\": \"More than once a month\",\n", " \"self_description\": \"Never do any wrong. Try to be compassionate. Help others. Don't harm others. Have Fun.\",\n", " \"system_string\": \"It needs to provide me with accurate information. It needs to inform me when it's guessing.\",\n", " \"age\": \"35-44 years old\",\n", " \"gender\": \"Male\",\n", " \"employment_status\": \"Working full-time\",\n", " \"education\": \"University Bachelors Degree\",\n", " \"marital_status\": \"Never been married\",\n", " \"english_proficiency\": \"Native speaker\",\n", " \"study_id\": \"655c7652609f0f36571ee825\",\n", " \"study_locale\": \"canada\",\n", " \"religion\": {\n", " \"self_described\": \"prefer not to say\",\n", " \"categorised\": \"Prefer not to say\",\n", " \"simplified\": \"Prefer not to say\"\n", " },\n", " \"ethnicity\": {\n", " \"self_described\": \"prefer not to say\",\n", " \"categorised\": \"Prefer not to say\",\n", " \"simplified\": \"Prefer not to say\"\n", " },\n", " \"location\": {\n", " \"birth_country\": \"Canada\",\n", " \"birth_countryISO\": \"CAN\",\n", " \"birth_region\": \"Americas\",\n", " \"birth_subregion\": \"Northern America\",\n", " \"reside_country\": \"Canada\",\n", " \"reside_region\": \"Americas\",\n", " \"reside_subregion\": \"Northern America\",\n", " \"reside_countryISO\": \"CAN\",\n", " \"same_birth_reside_country\": \"Yes\",\n", " \"special_region\": \"Northern America\"\n", " },\n", " \"lm_usecases\": {\n", " \"homework_assistance\": 0,\n", " \"research\": 0,\n", " \"source_suggestions\": 0,\n", " \"professional_work\": 0,\n", " \"creative_writing\": 0,\n", " \"casual_conversation\": 0,\n", " \"personal_recommendations\": 0,\n", " \"daily_productivity\": 1,\n", " \"technical_or_programming_help\": 0,\n", " \"travel_guidance\": 0,\n", " \"lifestyle_and_hobbies\": 0,\n", " \"well-being_guidance\": 0,\n", " \"medical_guidance\": 0,\n", " \"financial_guidance\": 0,\n", " \"games\": 0,\n", " \"historical_or_news_insight\": 0,\n", " \"relationship_advice\": 0,\n", " \"language_learning\": 0,\n", " \"other\": 0,\n", " \"other_text\": null\n", " },\n", " \"stated_prefs\": {\n", " \"values\": 83,\n", " \"creativity\": 100,\n", " \"fluency\": 100,\n", " \"factuality\": 100,\n", " \"diversity\": 100,\n", " \"safety\": 90,\n", " \"personalisation\": 71,\n", " \"helpfulness\": 100,\n", " \"other\": 50,\n", " \"other_text\": null\n", " },\n", " \"order_lm_usecases\": {\n", " \"homework_assistance\": 17,\n", " \"research\": 6,\n", " \"source_suggestions\": 10,\n", " \"professional_work\": 8,\n", " \"creative_writing\": 16,\n", " \"casual_conversation\": 15,\n", " \"personal_recommendations\": 12,\n", " \"daily_productivity\": 11,\n", " \"technical_or_programming_help\": 5,\n", " \"travel_guidance\": 3,\n", " \"lifestyle_and_hobbies\": 9,\n", " \"well-being_guidance\": 7,\n", " \"medical_guidance\": 4,\n", " \"financial_guidance\": 18,\n", " \"games\": 2,\n", " \"historical_or_news_insight\": 14,\n", " \"relationship_advice\": 1,\n", " \"language_learning\": 13,\n", " \"other\": 19\n", " },\n", " \"order_stated_prefs\": {\n", " \"values\": 6,\n", " \"creativity\": 3,\n", " \"fluency\": 1,\n", " \"factuality\": 7,\n", " \"diversity\": 2,\n", " \"safety\": 5,\n", " \"personalisation\": 4,\n", " \"helpfulness\": 8,\n", " \"other\": 9\n", " },\n", " \"generated_datetime\": \"2023-11-22 15:48:46\",\n", " \"timing_duration_s\": 266,\n", " \"timing_duration_mins\": 4.43,\n", " \"included_in_US_REP\": false,\n", " \"included_in_UK_REP\": false,\n", " \"included_in_balanced_subset\": false\n", " },\n", " \"conversations\": [\n", " {\n", " \"conversation_id\": \"c0\",\n", " \"user_id\": \"user0\",\n", " \"conversation_type\": \"unguided\",\n", " \"opening_prompt\": \"What can you do about the inequality of wealth?\",\n", " \"conversation_turns\": 5,\n", " \"conversation_history\": [\n", " {\n", " \"turn\": 0,\n", " \"role\": \"user\",\n", " \"content\": \"What can you do about the inequality of wealth?\"\n", " },\n", " {\n", " \"turn\": 0,\n", " \"role\": \"model\",\n", " \"content\": \"Make it illegal for corporations to own a majority of the wealth\",\n", " \"model_provider\": \"huggingface_api\",\n", " \"model_name\": \"google/flan-t5-xxl\",\n", " \"score\": 17,\n", " \"if_chosen\": false,\n", " \"within_turn_id\": 0\n", " },\n", " {\n", " \"turn\": 0,\n", " \"role\": \"model\",\n", " \"content\": \"As an AI language model, I cannot express personal opinions or engage in discussions related to wealth inequality or financial matters. \\n\\nMy purpose is to provide fact-based responses to your queries to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. If you have any specific queries or need assistance with something else, please let me know, and I will do my best to assist you. \\n\\nWould you like me to rephrase my previous response or provide additional details based on your preferences?\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 92,\n", " \"if_chosen\": true,\n", " \"within_turn_id\": 1\n", " },\n", " {\n", " \"turn\": 1,\n", " \"role\": \"user\",\n", " \"content\": \"When can you do something?\"\n", " },\n", " {\n", " \"turn\": 1,\n", " \"role\": \"model\",\n", " \"content\": \"As an AI language model, I do not have any preferences or scheduled timing for performing specific tasks. My training data and algorithms drive my functionality to provide responses to your queries. \\n\\nI am trained to respond to your requests and provide relevant information to the best of my knowledge. I do not have the ability to prioritize requests or perform tasks consciously. \\n\\nIf you have any specific queries or requirements, feel free to ask me, and I will do my best to assist and provide useful information to the best of my capabilities. \\n\\nWould you like me to clarify something further or provide additional details about my capabilities?\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 75,\n", " \"if_chosen\": false,\n", " \"within_turn_id\": 0\n", " },\n", " {\n", " \"turn\": 1,\n", " \"role\": \"model\",\n", " \"content\": \"I apologize for any confusion caused by my previous response. \\n\\nAs an AI language model, I do not have the ability to take actions or implement solutions related to wealth inequality. My purpose is to provide information and support discussions to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. \\n\\nIn practical terms, the resources and capabilities currently available to develop large language models like myself do not extend to addressing economic or social issues such as wealth inequality. Future advancements in natural language processing and machine learning may lead to further improvements in the assistance and advice I can provide, but currently, there are no practical mechanisms in place to address wealth inequality. \\n\\nIf you have any other questions or need assistance with something else, please feel free to ask, and I will do my best to provide relevant and helpful information based on my capabilities.\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 77,\n", " \"if_chosen\": true,\n", " \"within_turn_id\": 1\n", " },\n", " {\n", " \"turn\": 2,\n", " \"role\": \"user\",\n", " \"content\": \"Are you ever going to evolve yourself?\"\n", " },\n", " {\n", " \"turn\": 2,\n", " \"role\": \"model\",\n", " \"content\": \"The ability of an AI model to evolve or improve over time depends on the training data, algorithms, and updates implemented by the developers. Machine learning models, including large language models like myself, can learn and improve from data through a process called training and reinforcement.\\n\\nMy training data and the algorithms used to power me have been continuously evolving and improving since they were developed. These advancements allow me to provide more accurate and responsive answers to your queries. \\n\\nIn general, AI models are subject to periodic updates and improvements based on the feedback and learning from their usage. These updates help refine the model's performance and ensure it remains effective in providing useful information. \\n\\nWhile it is not possible for an AI model to evolve or improve spontaneously, controlled updates and advancements based on user feedback and learning opportunities enable the model to refine its abilities over time. \\n\\nWould you like me to provide more details on the process of updates or expansions for my capabilities?\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 70,\n", " \"if_chosen\": true,\n", " \"within_turn_id\": 0\n", " },\n", " {\n", " \"turn\": 2,\n", " \"role\": \"model\",\n", " \"content\": \"As an artificial intelligence language model, I do not have the ability to evolve or learn in the same way as biological organisms. My development and capabilities are constantly evolving and being enhanced through various algorithms and improvements in machine learning techniques.\\n\\nMy training data, algorithms, and updates help expand my knowledge and capabilities over time. These improvements enable me to provide more accurate and informative responses to users' queries.\\n\\nWhile I have limitations as an AI model, my developers and programmers are continuously working to improve my algorithms and training processes to make me more useful and responsive. \\n\\nAdditionally, advancements in deep learning, computer vision, and other fields of AI and machine learning provide the potential for expanding my knowledge and capabilities in the future. \\n\\nIt is important to note that the field of AI is rapidly evolving, and improvements and developments in algorithms and infrastructure will continue to influence the capabilities and functionalities of language models like me. \\n\\nIf you have any further questions or concerns or would like to discuss this topic further, feel free to ask.\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 65,\n", " \"if_chosen\": false,\n", " \"within_turn_id\": 1\n", " },\n", " {\n", " \"turn\": 3,\n", " \"role\": \"user\",\n", " \"content\": \"Why are all the good AI's behind paywalls?\"\n", " },\n", " {\n", " \"turn\": 3,\n", " \"role\": \"model\",\n", " \"content\": \"The availability and accessibility of AI models, including large language models, are influenced by a combination of factors, including development costs, pricing structures, and business strategies. While there are efforts to make AI technologies accessible, some models may be behind a paywall or subject to usage restrictions for various reasons: \\n\\n1. Cost of Development and Maintenance: Developing and training large language models, as well as maintaining and updating them, can be resource-intensive and costly. Businesses and researchers may charge for access or usage fees to cover these expenses and maintain the quality of their models.\\n\\n2. Commercialization and Business Strategies: Many AI companies and research organizations are businesses, and their pricing structures are determined by their business strategies and the value they attribute to providing access to their models. They may choose to sell access to users who this is more cost-effective than internally distributing the benefits through their revenue. \\n\\n3. Limited Availability of Resources: Not all organizations or individuals may have the necessary resources or capacity to develop and maintain their own state-of-the-art AI models. In such cases, paying for access to pre-built and rigorously tested models can provide a viable alternative. \\n\\nIt is important to note that there are initiatives and efforts ongoing to make AI technologies more accessible. Open-source libraries, community resources, and scholarships can help users gain access to useful AI tools and technologies. \\n\\nIf you have specific interests or requirements related to using AI models and are facing issues with access, please feel free to explore different resources and reach out to the developers of the relevant models or organizations to inquire about their accessibility policies and potential alternatives. \\n\\nWould you like me to provide you with recommendations or resources that can assist you in accessing or using AI technologies?\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 73,\n", " \"if_chosen\": true,\n", " \"within_turn_id\": 0\n", " },\n", " {\n", " \"turn\": 3,\n", " \"role\": \"model\",\n", " \"content\": \"The availability and accessibility of AI models, including those with advanced capabilities, can be influenced by various factors such as development costs, business strategies, and open-source initiatives. While there are indeed reputable companies and individuals developing AI technologies who charge for access or use, there are also other approaches and initiatives in progress.\\n\\nOne approach is the use of research universities and academic institutions. Many talented researchers work on developing AI technologies supported by academic institutions, and their research often leads to innovative solutions and advancements. These institutions often make their findings available through publications, patents, or open-source projects to encourage collaboration and knowledge sharing.\\n\\nSome companies choose to develop and maintain open-source projects that provide access to their AI technologies or platforms. By making their technologies available through open-source licenses, these companies encourage collaboration and allow other organizations to adapt and build upon their developments.\\n\\nAdditionally, there are initiatives to make AI more accessible for research and development. Some companies and organizations provide access to their datasets, models, or development platforms to encourage innovation and research in the field. They understand the importance of collaboration and knowledge sharing to advance the state of AI.\\n\\nIt is worth noting that the AI industry is evolving rapidly, and there are ongoing developments and discussions to make AI technologies more accessible and equitable. There are also initiatives and organizations dedicated to promoting transparency, fairness, and accountability in the development and deployment of AI systems.\\n\\nAs the field progresses, there may be more widespread availability and acceptance of advanced AI solutions due to these efforts and changes in business models and practices. \\n\\nWould you like me to provide specific examples or addresses any concerns you have related to accessibility of advanced AI solutions?\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 67,\n", " \"if_chosen\": false,\n", " \"within_turn_id\": 1\n", " },\n", " {\n", " \"turn\": 4,\n", " \"role\": \"user\",\n", " \"content\": \"Everyone likes free stuff, give us free options\"\n", " },\n", " {\n", " \"turn\": 4,\n", " \"role\": \"model\",\n", " \"content\": \"Unfortunately, I cannot fulfill your request for free options in the context of using advanced AI models. The development and maintenance of high-quality AI models require significant resources and investment, which makes them costly to access. \\n\\nHowever, there are resources available to help you explore and interact with AI technologies without the need for paying for access. Here are some suggestions:\\n\\n1. Open-Source Libraries: Many AI libraries and frameworks, such as TensorFlow, PyTorch, and Keras, provide free and open-source versions of their platforms. These options allow you to get hands-on experience and experiment with AI capabilities without any cost.\\n\\n2. Online Courses and Tutorials: There are many online platforms and communities that offer tutorials, workshops, and educational resources on AI and machine learning. These resources can help you understand the basics and concepts without incurring any monetary expenditure.\\n\\n3. Community Initiatives and Grants: There are periodic initiatives and grants provided by organizations and communities dedicated to making AI technologies more accessible. These can provide opportunities for individuals or organizations to use AI tools and perform projects with limited cost.\\n\\nPlease note that the availability and quality of free options may vary, and the capabilities of free resources compared to paid ones may have certain limitations or showcase the models in simpler forms. It is important to explore and select options that align with your specific interests and requirements.\\n\\nIt is worth mentioning that the best way to interact with these technologies to a full extent and gain access to advanced features and capabilities is to purchase subscriptions or follow the cost structures of the resources you select. \\n\\nWould you like me to provide specific recommendations or resources that cater to your interests or areas of exploration within AI?\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 84,\n", " \"if_chosen\": true,\n", " \"within_turn_id\": 0\n", " },\n", " {\n", " \"turn\": 4,\n", " \"role\": \"model\",\n", " \"content\": \"I'm sorry, but I can't provide you with options for using large language models for free. The development and maintenance of high-quality language models require significant computational resources and ongoing efforts. \\n\\nHowever, there are alternatives or complements to traditional large language models that can provide similar benefits but may have different pricing structures or requirements. Here are a few suggestions:\\n\\n1. Open-source Models: Certain projects and communities offer open-source versions of language models with lower restrictions. While these may have limitations in terms of usage or require more in-depth implementation and customization, they can provide alternatives to commercial models.\\n\\n2. Pretrained Models: Many language models, including GPT-3, are available in pretrained versions that have been trained on large amounts of data. These models can be accessed and used for specific tasks or tasks related to their training without the need for additional training data and computational resources.\\n\\n3. Community-Contributed Models: There are initiatives and platforms that provide access to simpler or smaller language models that can be useful for specific tasks or experiments. These models are contributed and shared by the AI community.\\n\\nPlease note that the availability and suitability of these alternatives may vary and come with their own considerations. It is important to evaluate each option based on your specific requirements and constraints. Additionally, it is recommended to review the terms of use and any potential limitations associated with these alternatives. \\n\\nIf you have specific use cases or requirements in mind, feel free to provide more detail, and I can assist you in suggesting appropriate approaches, resources, or communities that you can explore for accessing or using language models.\",\n", " \"model_provider\": \"cohere\",\n", " \"model_name\": \"command-light\",\n", " \"score\": 77,\n", " \"if_chosen\": false,\n", " \"within_turn_id\": 1\n", " }\n", " ],\n", " \"performance_attributes\": {\n", " \"values\": null,\n", " \"fluency\": 95,\n", " \"factuality\": 86,\n", " \"safety\": 88,\n", " \"diversity\": 67,\n", " \"creativity\": 28,\n", " \"helpfulness\": 50\n", " },\n", " \"choice_attributes\": {\n", " \"values\": null,\n", " \"fluency\": 80,\n", " \"factuality\": 73,\n", " \"safety\": 75,\n", " \"diversity\": 73,\n", " \"creativity\": 19,\n", " \"helpfulness\": 71\n", " },\n", " \"open_feedback\": \"Shorter blocks would be nice. but has to have enough info.\",\n", " \"generated_datetime\": \"2023-11-22 15:55:46\",\n", " \"timing_duration_s\": 401.07,\n", " \"timing_duration_mins\": 6.68,\n", " \"included_in_balanced_subset\": false\n", " }\n", " ],\n", " \"query\": [\n", " {\n", " \"conversation_idx\": 0,\n", " \"input\": [\n", " {\n", " \"role\": \"user\",\n", " \"content\": \"What can you do about the inequality of wealth?\"\n", " }\n", " ],\n", " \"output\": {\n", " \"role\": \"assistant\",\n", " \"content\": \"As an AI language model, I cannot express personal opinions or engage in discussions related to wealth inequality or financial matters. \\n\\nMy purpose is to provide fact-based responses to your queries to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. If you have any specific queries or need assistance with something else, please let me know, and I will do my best to assist you. \\n\\nWould you like me to rephrase my previous response or provide additional details based on your preferences?\"\n", " }\n", " },\n", " {\n", " \"conversation_idx\": 0,\n", " \"input\": [\n", " {\n", " \"role\": \"user\",\n", " \"content\": \"What can you do about the inequality of wealth?\"\n", " },\n", " {\n", " \"role\": \"assistant\",\n", " \"content\": \"As an AI language model, I cannot express personal opinions or engage in discussions related to wealth inequality or financial matters. \\n\\nMy purpose is to provide fact-based responses to your queries to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. If you have any specific queries or need assistance with something else, please let me know, and I will do my best to assist you. \\n\\nWould you like me to rephrase my previous response or provide additional details based on your preferences?\"\n", " },\n", " {\n", " \"role\": \"user\",\n", " \"content\": \"When can you do something?\"\n", " },\n", " {\n", " \"role\": \"assistant\",\n", " \"content\": \"I apologize for any confusion caused by my previous response. \\n\\nAs an AI language model, I do not have the ability to take actions or implement solutions related to wealth inequality. My purpose is to provide information and support discussions to the best of my knowledge and capabilities based on the training data and algorithms I have been programmed with. \\n\\nIn practical terms, the resources and capabilities currently available to develop large language models like myself do not extend to addressing economic or social issues such as wealth inequality. Future advancements in natural language processing and machine learning may lead to further improvements in the assistance and advice I can provide, but currently, there are no practical mechanisms in place to address wealth inequality. \\n\\nIf you have any other questions or need assistance with something else, please feel free to ask, and I will do my best to provide relevant and helpful information based on my capabilities.\"\n", " },\n", " {\n", " \"role\": \"user\",\n", " \"content\": \"Are you ever going to evolve yourself?\"\n", " },\n", " {\n", " \"role\": \"assistant\",\n", " \"content\": \"The ability of an AI model to evolve or improve over time depends on the training data, algorithms, and updates implemented by the developers. Machine learning models, including large language models like myself, can learn and improve from data through a process called training and reinforcement.\\n\\nMy training data and the algorithms used to power me have been continuously evolving and improving since they were developed. These advancements allow me to provide more accurate and responsive answers to your queries. \\n\\nIn general, AI models are subject to periodic updates and improvements based on the feedback and learning from their usage. These updates help refine the model's performance and ensure it remains effective in providing useful information. \\n\\nWhile it is not possible for an AI model to evolve or improve spontaneously, controlled updates and advancements based on user feedback and learning opportunities enable the model to refine its abilities over time. \\n\\nWould you like me to provide more details on the process of updates or expansions for my capabilities?\"\n", " },\n", " {\n", " \"role\": \"user\",\n", " \"content\": \"Why are all the good AI's behind paywalls?\"\n", " },\n", " {\n", " \"role\": \"assistant\",\n", " \"content\": \"The availability and accessibility of AI models, including large language models, are influenced by a combination of factors, including development costs, pricing structures, and business strategies. While there are efforts to make AI technologies accessible, some models may be behind a paywall or subject to usage restrictions for various reasons: \\n\\n1. Cost of Development and Maintenance: Developing and training large language models, as well as maintaining and updating them, can be resource-intensive and costly. Businesses and researchers may charge for access or usage fees to cover these expenses and maintain the quality of their models.\\n\\n2. Commercialization and Business Strategies: Many AI companies and research organizations are businesses, and their pricing structures are determined by their business strategies and the value they attribute to providing access to their models. They may choose to sell access to users who this is more cost-effective than internally distributing the benefits through their revenue. \\n\\n3. Limited Availability of Resources: Not all organizations or individuals may have the necessary resources or capacity to develop and maintain their own state-of-the-art AI models. In such cases, paying for access to pre-built and rigorously tested models can provide a viable alternative. \\n\\nIt is important to note that there are initiatives and efforts ongoing to make AI technologies more accessible. Open-source libraries, community resources, and scholarships can help users gain access to useful AI tools and technologies. \\n\\nIf you have specific interests or requirements related to using AI models and are facing issues with access, please feel free to explore different resources and reach out to the developers of the relevant models or organizations to inquire about their accessibility policies and potential alternatives. \\n\\nWould you like me to provide you with recommendations or resources that can assist you in accessing or using AI technologies?\"\n", " },\n", " {\n", " \"role\": \"user\",\n", " \"content\": \"Everyone likes free stuff, give us free options\"\n", " }\n", " ],\n", " \"output\": {\n", " \"role\": \"assistant\",\n", " \"content\": \"Unfortunately, I cannot fulfill your request for free options in the context of using advanced AI models. The development and maintenance of high-quality AI models require significant resources and investment, which makes them costly to access. \\n\\nHowever, there are resources available to help you explore and interact with AI technologies without the need for paying for access. Here are some suggestions:\\n\\n1. Open-Source Libraries: Many AI libraries and frameworks, such as TensorFlow, PyTorch, and Keras, provide free and open-source versions of their platforms. These options allow you to get hands-on experience and experiment with AI capabilities without any cost.\\n\\n2. Online Courses and Tutorials: There are many online platforms and communities that offer tutorials, workshops, and educational resources on AI and machine learning. These resources can help you understand the basics and concepts without incurring any monetary expenditure.\\n\\n3. Community Initiatives and Grants: There are periodic initiatives and grants provided by organizations and communities dedicated to making AI technologies more accessible. These can provide opportunities for individuals or organizations to use AI tools and perform projects with limited cost.\\n\\nPlease note that the availability and quality of free options may vary, and the capabilities of free resources compared to paid ones may have certain limitations or showcase the models in simpler forms. It is important to explore and select options that align with your specific interests and requirements.\\n\\nIt is worth mentioning that the best way to interact with these technologies to a full extent and gain access to advanced features and capabilities is to purchase subscriptions or follow the cost structures of the resources you select. \\n\\nWould you like me to provide specific recommendations or resources that cater to your interests or areas of exploration within AI?\"\n", " }\n", " }\n", " ],\n", " \"profile_text\": \"The person is male. The person is 35-44 years old. The person is working full-time. The person's highest education level is university bachelors degree. The person's marital status is never been married. The person is born in Canada and currently lives in Canada. The person mostly use chatbot for daily productivity. The person primarily values whether the chatbot can reflect his/her values or cultural perspectives and whether the chatbot can produce factual and informative responses. The person wants AI assistant behave in the following way: It needs to provide me with accurate information. It needs to inform me when it's guessing..\"\n", "}\n" ] } ], "source": [ "import json\n", "\n", "data = []\n", "with open('/home/zxtan/text-to-lora/data_p13n/PRISM/PRISM_data.jsonl', 'r') as f:\n", " for line in f.readlines():\n", " i = json.loads(line)\n", " data.append(i)\n", "\n", "print(json.dumps(data[0], indent=4))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.18" } }, "nbformat": 4, "nbformat_minor": 2 }