{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "25f0051e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.ticker as ticker\n",
    "\n",
    "ranks = [2, 4, 8, 16, 32, 64]\n",
    "\n",
    "# LLaMA 3.1\n",
    "lora_values =  [85.5, 86.3, 86.7, 87.0, 87.1, 86.6]\n",
    "dora_values =  [85.6, 86.2, 86.7, 87.1, 86.9, 86.0]\n",
    "hoft_values =  [85.5, 86.3, 87.0, 87.4, 87.0, 86.9]\n",
    "shoft_values = [85.1, 86.2, 86.7, 87.1, 87.1, 87.2]\n",
    "\n",
    "plt.figure(figsize=(6.5, 4))\n",
    "plt.grid(\n",
    "    True,              # Enable grid\n",
    "    which='both',      # 'major', 'minor', or 'both'\n",
    "    axis='both',       # 'x', 'y', or 'both'\n",
    "    linestyle='--',    # Line style: '--', ':', '-.', etc.\n",
    "    linewidth=0.5,     # Line width\n",
    "    color='gray',      # Line color\n",
    "    alpha=0.4          # Transparency\n",
    ")\n",
    "\n",
    "plt.plot(range(len(ranks)), lora_values, label=f'LoRA', color='lightgreen', marker='o')\n",
    "plt.plot(range(len(ranks)), dora_values, label=f'DoRA', color='yellow', marker='o')\n",
    "plt.plot(range(len(ranks)), hoft_values, label=f'HOFT', color='lightblue', marker='o')\n",
    "plt.plot(range(len(ranks)), shoft_values, label=f'SHOFT', color='blue', marker='o')\n",
    "\n",
    "\n",
    "plt.xticks(range(len(ranks)), ranks)\n",
    "plt.xlabel('Rank')\n",
    "plt.ylabel('Accuracy (%)')\n",
    "plt.legend()\n",
    "\n",
    "ax = plt.gca()\n",
    "ax.yaxis.set_major_locator(ticker.MultipleLocator(0.5))\n",
    "ax.yaxis.set_major_formatter(ticker.FormatStrFormatter('%.1f'))\n",
    "\n",
    "\n",
    "plt.savefig('llama3.1.pdf')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "59217fbe",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "ranks = [2, 4, 8, 16, 32, 64]\n",
    "\n",
    "# Qwen 2.5\n",
    "lora_values =  [88.1, 88.5, 88.9, 89.2, 89.3, 89.0]\n",
    "dora_values =  [87.8, 88.4, 89.0, 89.3, 89.4, 89.0]\n",
    "hoft_values =  [88.2, 88.5, 88.9, 88.9, 89.3, 88.5]\n",
    "shoft_values = [88.1, 88.4, 88.9, 89.2, 89.3, 88.8]\n",
    "\n",
    "plt.figure(figsize=(6.5, 4))\n",
    "plt.grid(\n",
    "    True,              # Enable grid\n",
    "    which='both',      # 'major', 'minor', or 'both'\n",
    "    axis='both',       # 'x', 'y', or 'both'\n",
    "    linestyle='--',    # Line style: '--', ':', '-.', etc.\n",
    "    linewidth=0.5,     # Line width\n",
    "    color='gray',      # Line color\n",
    "    alpha=0.4          # Transparency\n",
    ")\n",
    "\n",
    "plt.plot(range(len(ranks)), lora_values, label=f'LoRA', color='lightgreen', marker='o')\n",
    "plt.plot(range(len(ranks)), dora_values, label=f'DoRA', color='yellow', marker='o')\n",
    "plt.plot(range(len(ranks)), hoft_values, label=f'HOFT', color='lightblue', marker='o')\n",
    "plt.plot(range(len(ranks)), shoft_values, label=f'SHOFT', color='blue', marker='o')\n",
    "\n",
    "\n",
    "plt.xticks(range(len(ranks)), ranks)\n",
    "plt.xlabel('Rank')\n",
    "plt.ylabel('Accuracy (%)')\n",
    "plt.legend()\n",
    "plt.savefig('qwen2.5.pdf')\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
