diff options
Diffstat (limited to 'notebooks/Riddles_FixedPos.ipynb')
-rw-r--r-- | notebooks/Riddles_FixedPos.ipynb | 302 |
1 files changed, 302 insertions, 0 deletions
diff --git a/notebooks/Riddles_FixedPos.ipynb b/notebooks/Riddles_FixedPos.ipynb new file mode 100644 index 0000000..5e42e0b --- /dev/null +++ b/notebooks/Riddles_FixedPos.ipynb @@ -0,0 +1,302 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "execution_state": "idle", + "id": "1ddfc692-bda7-4d38-a549-2fb0d40d437d", + "metadata": {}, + "outputs": [], + "source": [ + "import math\n", + "import os\n", + "import sys\n", + "\n", + "sys.path.append(\"..\")\n", + "\n", + "import torch\n", + "import transformers\n", + "from safetensors import safe_open\n", + "\n", + "from utils import add_attn_hooks\n", + "\n", + "# text_dir = \"rtl\"\n", + "text_dir = \"ltr\"\n", + "# tokenizer = transformers.AutoTokenizer.from_pretrained(\"bert-base-uncased\")\n", + "# model = transformers.AutoModelForMaskedLM.from_pretrained(f\"/home/sipb/nlp-class-project/checkpoints/bert_base_{text_dir}/epoch_3_checkpt\", ignore_mismatched_sizes=True)\n", + "\n", + "tokenizer = transformers.AutoTokenizer.from_pretrained(\"distilbert/distilbert-base-uncased\")" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "execution_state": "idle", + "id": "eaf99031-9141-43dd-89ba-be9b8e63a1ba", + "metadata": {}, + "outputs": [], + "source": [ + "with open(\"/home/sipb/nlp-class-project/data/riddles.txt\", \"r\") as f:\n", + " riddles_qa = [line.rstrip() for line in f.readlines()]\n", + "\n", + "with open(\"/home/sipb/nlp-class-project/data/ltr_riddles.txt\", \"r\") as f:\n", + " riddles_aq = [line.rstrip() for line in f.readlines()]" + ] + }, + { + "cell_type": "code", + "execution_count": 167, + "execution_state": "idle", + "id": "94da0be0-d6ef-46be-9fff-4ebf022e4fed", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_6_ltr_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_6_rtl_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_11_ltr_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_11_rtl_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_19_ltr_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_19_rtl_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_35_ltr_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/bert_35_rtl_scratch/epoch_3_checkpt were not used when initializing BertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing BertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing BertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/distilbert_base_ltr_scratch/epoch_3_checkpt were not used when initializing DistilBertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing DistilBertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing DistilBertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", + "Some weights of the model checkpoint at /home/sipb/nlp-class-project/checkpoints/distilbert_base_rtl_scratch/epoch_3_checkpt were not used when initializing DistilBertForMaskedLM: ['attention_mask']\n", + "- This IS expected if you are initializing DistilBertForMaskedLM from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", + "- This IS NOT expected if you are initializing DistilBertForMaskedLM from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n" + ] + } + ], + "source": [ + "results = []\n", + "path_prefixes = [f\"bert_{size}\" for size in (6, 11, 19, 35)] + [\"distilbert_base\"]\n", + "for path_prefix in path_prefixes:\n", + " for text_dir in (\"ltr\", \"rtl\"):\n", + " checkpt_dir = f\"/home/sipb/nlp-class-project/checkpoints/{path_prefix}_{text_dir}_scratch/epoch_3_checkpt\"\n", + "\n", + "# path_prefixes = [\"distilbert_base\", \"bert_base\", \"bert_large\"]\n", + "# for path_prefix in path_prefixes:\n", + "# for text_dir in (\"ltr\", \"rtl\"):\n", + " # checkpt_dir = f\"/home/sipb/nlp-class-project/checkpoints/{path_prefix}_{text_dir}/epoch_3_checkpt\"\n", + " # model = load_checkpt(f\"/home/sipb/nlp-class-project/checkpoints/{path_prefix}_{text_dir}/epoch_3_checkpt\")\n", + " # config = transformers.AutoConfig.from_pretrained(os.path.join(checkpt_dir, \"config.json\"))\n", + " # config.max_position_embeddings = 512\n", + " try:\n", + " model = transformers.AutoModelForMaskedLM.from_pretrained(checkpt_dir)\n", + " except:\n", + " config = transformers.AutoConfig.from_pretrained(os.path.join(checkpt_dir, \"config.json\"))\n", + " config.max_position_embeddings = 512\n", + " model = transformers.AutoModelForMaskedLM.from_pretrained(checkpt_dir, config=config)\n", + " \n", + " add_attn_hooks(model, text_dir)\n", + " model.eval();\n", + "\n", + " for dataset_type, dataset in [\n", + " (\"qa\", riddles_qa),\n", + " (\"aq\", riddles_aq),\n", + " ]:\n", + " ppls = []\n", + " for riddle in dataset:\n", + " batch = tokenizer([riddle], return_tensors=\"pt\", padding_side=\"left\" if text_dir == \"rtl\" else \"right\", padding=\"max_length\", max_length=128)\n", + " batch[\"labels\"] = batch[\"input_ids\"].clone()\n", + " batch[\"labels\"][batch[\"attention_mask\"] == 0] = -100\n", + " with torch.inference_mode():\n", + " output = model(**batch)\n", + " ppls.append(math.e ** output.loss.item())\n", + "\n", + " results.append((sum(ppls) / len(ppls), dataset_type, text_dir, path_prefix))" + ] + }, + { + "cell_type": "code", + "execution_count": 166, + "execution_state": "idle", + "id": "bdee66ad-65ad-40c7-ac86-9a2d6b8fba02", + "metadata": {}, + "outputs": [], + "source": [ + "to_params = {\n", + " \"bert_6\": 6,\n", + " \"bert_11\": 11,\n", + " \"bert_19\": 19,\n", + " \"bert_35\": 35,\n", + " \"distilbert_base\": 67,\n", + " \"bert_base\": 110,\n", + " \"bert_large\": 335,\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 168, + "execution_state": "idle", + "id": "d1668465-fe85-4310-8d88-031d4b8d361f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "LTR & 6M & AQ & 2420 \\\\\n", + "RTL & 6M & AQ & 2570 \\\\\n", + "LTR & 11M & AQ & 1930 \\\\\n", + "RTL & 11M & AQ & 2710 \\\\\n", + "LTR & 19M & AQ & 2930 \\\\\n", + "RTL & 19M & AQ & 5820 \\\\\n", + "LTR & 35M & AQ & 6270 \\\\\n", + "RTL & 35M & AQ & 11600 \\\\\n", + "LTR & 67M & AQ & 9790 \\\\\n", + "RTL & 67M & AQ & 32500 \\\\\n", + "LTR & 6M & QA & 1960 \\\\\n", + "RTL & 6M & QA & 1770 \\\\\n", + "LTR & 11M & QA & 1630 \\\\\n", + "RTL & 11M & QA & 1710 \\\\\n", + "LTR & 19M & QA & 2610 \\\\\n", + "RTL & 19M & QA & 3330 \\\\\n", + "LTR & 35M & QA & 5080 \\\\\n", + "RTL & 35M & QA & 5410 \\\\\n", + "LTR & 67M & QA & 7160 \\\\\n", + "RTL & 67M & QA & 27600 \\\\\n" + ] + } + ], + "source": [ + "for ppl, task, text_dir, path_prefix in sorted(results, key=lambda x: (x[1], to_params[x[3]], x[2])):\n", + " ppl = int(float(f\"{ppl:.3g}\"))\n", + " print(rf\"{text_dir.upper()} & {to_params[path_prefix]}M & {task.upper()} & {ppl} \\\\\")" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "execution_state": "idle", + "id": "8894ca16-58e3-4448-bec8-c962f5135737", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the more you take, the more you leave behind. what am i? @ @ @ @ @ @ @ @ @ @ @ @ @ the @ @ @ @ ( the the the. @ the @ @ ( @ @ ( @ @ @ @ ( the.. @ ( @ ) @ the @ the the\n" + ] + } + ], + "source": [ + "# input_text = [\"The more you take, the more you leave behind. What am I?\"]\n", + "# batch = tokenizer(input_text, return_tensors=\"pt\", padding_side=\"right\", padding=\"max_length\", max_length=64)\n", + "# output_ids = model.generate(batch['input_ids'], max_length=128, do_sample=False) # do_sample=False ensures greedy decoding\n", + "# decoded_output = tokenizer.decode(output_ids[0], skip_special_tokens=True)\n", + "# print(decoded_output)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "execution_state": "idle", + "id": "a4098975-2df6-4435-bc93-1a5afd6d7e68", + "metadata": {}, + "outputs": [], + "source": [ + "# CPU is fast enough\n", + "\n", + "ppls = []\n", + "for riddle in riddles:\n", + " batch = tokenizer([riddle], return_tensors=\"pt\", padding_side=\"left\" if text_dir == \"rtl\" else \"right\", padding=\"max_length\", max_length=128)\n", + " batch[\"labels\"] = batch[\"input_ids\"].clone()\n", + " batch[\"labels\"][batch[\"attention_mask\"] == 0] = -100\n", + " # batch = tokenizer([riddle], return_tensors=\"pt\")#, padding_side=\"left\" if text_dir == \"rtl\" else \"right\", padding=\"longest\", max_length=128)\n", + " # batch[\"labels\"] = batch[\"input_ids\"]\n", + " with torch.inference_mode():\n", + " output = model(**batch)\n", + " ppls.append(math.e ** output.loss.item())" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "execution_state": "idle", + "id": "c68b5235-a4a7-4f38-9acb-f5072e546a96", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([ 4., 6., 11., 6., 5., 2., 1., 1., 2., 2.]),\n", + " array([ 613.56297843, 829.36555779, 1045.16813716, 1260.97071653,\n", + " 1476.77329589, 1692.57587526, 1908.37845463, 2124.18103399,\n", + " 2339.98361336, 2555.78619272, 2771.58877209]),\n", + " <BarContainer object of 10 artists>)" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGdCAYAAACyzRGfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAY8UlEQVR4nO3df5DVVf348dcCsoCyyy9ZIBdZf4ym4E+MECMdGIHQsBpHjRqiRlMxJQqFCozMQGscJjM1Z1KbUbRmBBt/MGMokiMiIKikoRgKqUCJ7PJDV2TP54+v3vEKqPS99ywLj8fMnXHf78P7nMvhzj69P3YrUkopAAAyadXcCwAA9i/iAwDISnwAAFmJDwAgK/EBAGQlPgCArMQHAJCV+AAAsmrT3Av4uKampnjjjTeiY8eOUVFR0dzLAQA+g5RSbN68OXr16hWtWn3ycxt7XXy88cYbUVtb29zLAAD+B2vXro1DDjnkE8fsdfHRsWPHiA8WX1VV1dzLAQA+g4aGhqitrS18H/8ke118fPhSS1VVlfgAgBbms7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2/Dhw4vG2J/ymT59epxyyinRsWPH6N69e5xzzjmxcuXKojHvvvtujBs3Lrp27RoHHXRQfOMb39jpBy+uWbMmRo4cGR06dIju3bvHxIkT4/333y8aM3/+/DjppJOisrIyjjjiiLjjjjuy3MeW7rPs0emnn77T4+jiiy8uGmOPyiix33nooYfST3/603TfffeliEizZ88uOj9jxoxUXV2d5syZk5599tn01a9+NdXV1aV33nmnMGb48OHp+OOPT0899VT6+9//no444oh0wQUXFM7X19enmpqaNHr06LRixYo0a9as1L59+3Trrbdmva8t0aftz5gxY9Lw4cPTm2++Wbht3LixaIz9KZ9hw4al22+/Pa1YsSItX748feUrX0m9e/dOW7ZsKYy5+OKLU21tbZo3b15asmRJ+uIXv5hOPfXUwvn3338/9e3bNw0dOjQtW7YsPfTQQ6lbt25p8uTJhTH/+te/UocOHdKECRPSCy+8kG688cbUunXrNHfu3Oz3uaX5LHv05S9/OV144YVFj6P6+vrCeXtUXuJjP/fxb25NTU2pR48e6de//nXh2KZNm1JlZWWaNWtWSimlF154IUVEWrx4cWHMww8/nCoqKtLrr7+eUkrp97//fercuXNqbGwsjLnqqqvSUUcdleme7Rt2Fx+jRo3a7Z+xP3lt2LAhRUR6/PHHU/rg8XLAAQekv/zlL4UxL774YoqItHDhwpQ+CMxWrVqldevWFcbcfPPNqaqqqrAnV155ZTr22GOL5jrvvPPSsGHDMt2zfcfH9yh9EB9XXHHFbv+MPSovL7tQZPXq1bFu3boYOnRo4Vh1dXUMGDAgFi5cGBERCxcujE6dOkX//v0LY4YOHRqtWrWKRYsWFcYMHjw42rZtWxgzbNiwWLlyZbz99ttZ79O+aP78+dG9e/c46qij4pJLLom33nqrcM7+5FVfXx8REV26dImIiKVLl8b27duLHkNHH3109O7du+gx1K9fv6IfvDhs2LBoaGiIf/zjH4UxH73Gh2M+vAaf3cf36EN33XVXdOvWLfr27RuTJ0+Obdu2Fc7Zo/Jq9t9qy95l3bp1ERE7/TTampqawrl169ZF9+7di863adMmunTpUjSmrq5up2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BRekgw46KFVVVaWxY8emzZs3F4159tln02mnnZYqKyvT5z73uTRjxoys97Ol+qT92bZtWzrzzDPTwQcfnA444IB06KGHpgsvvLDo44DJ/pTVrvYmItLtt99eGPPOO++kSy+9NHXu3Dl16NAhfe1rX0tvvvlm0XVeffXVNGLEiNS+ffvUrVu39KMf/Sht3769aMxjjz2WTjjhhNS2bdt02GGHFc3B7n3aHq1ZsyYNHjw4denSJVVWVqYjjjgiTZw4sejnfCR7VFYV6f9tFABAFt7zAQBkJT4AgKzEBwCQlfgAALISHwBAVuIDAMhKfAAAWYkPACAr8QEAZCU+AICsxAcAkJX4AACy+j/J4r9i/nZCRAAAAABJRU5ErkJggg==", + "text/plain": [ + "<Figure size 640x480 with 1 Axes>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "plt.hist(ppls)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "86daa05b-5784-457b-b65e-8b8395128d6f", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.12.7" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} |