\section{Introduction}

Fog computing enables use cases where data produced in end devices are stored, processed, and acted on close to the edges of the network, preceding,  augmenting or even avoiding processing in the distant cloud and the data-centers associated with it~\cite{Bonomi2014}. For fog computing to flourish, however, cloud-like simplicity should be achieved in the development and the operations (DevOps) of these systems and services, a goal that only recently started to be addressed by the community with the use of containerization~\cite{Bellavista:2017:FFC:3007748.3007777,Hoque8029944,globecom2018}.

In the case of IoT (Internet of Things) systems, computational and storage resources are naturally available in the gateway segment of the IoT architecture, residing between low-power IoT devices and cloud services. Recently, several industrial and community-based initiatives focused on the development of software stacks for such gateways aiming to simplify DevOps for IoT services running on state-of-the-art IoT gateway hardware; providing readily available software components, rapid prototyping tools, cloud connectors, and device-, gateway-, fleet-management services. Although these platforms have scarce resources compared to servers in data-centers, modern hardware allows them to run complex processing tasks by deploying applications on the edge. Scalability is however still a challenge due to the limited resources and often widely varying operating conditions.

In this paper we present a practical approach to mitigate scalability problems by dynamically offloading computational tasks from edge to cloud resources, as an embedded part of a rapid prototyping environment, thus simplifying both the development and operation of such services.

Our paper provides the following contributions to the literature on offloading from edge to cloud:
\begin{itemize}
\item we introduce the concept of the on-demand offloading of computational tasks from IoT gateways to cloud instances and provide an implementation in Node-RED;
\item we identify offloading strategies and quantify some of the trade-offs involved.
\end{itemize}

The paper is structured as follows: after a brief introduction to the state-of-the-art in Sec.~\ref{sec:soa}, we introduce the role of rapid prototyping in the IoT gateway stack in Sec.~\ref{sec:rapid} and \ref{sec:nodered}. Our implementation of offloading is introduced in Sec.~\ref{sec:offloading} and evaluated through an image processing example in Sec.~\ref{sec:validation}.

\section{State of the Art}
\label{sec:soa}

Offloading computation from the gateway to the cloud resembles another scenario which has received considerable attention: offloading computation from mobile devices to the cloud. Enzai and Tang~\cite{6834942} present a taxonomy of the computation offloading approaches in Mobile Cloud Computing. Bangui et. al~\cite{DBLP:journals/jsan/BanguiGBRRP17} and Wu~\cite{8252700} published surveys on multi-objective decision-making to offload computation from mobile devices to the cloud. Although these approaches relate to our work, mobile devices are subject to constraints that do not necessarily apply to IoT gateways. For example, mobile devices are connected to networks with limited quotas or higher costs, and although this can also be the case for IoT gateways, it does not necessarily have to be the case. A similar consideration applies when considering energy consumption.

In the IoT gateways domain, pub/sub solutions have been considered to achieve computing offloading. Happ et al. ~\cite{Happ2017} analyze the main requirements of IoT platforms and evaluate how some existing pub/sub meet those requirements and their performance. Happ and Wolisz have described an approach to offload computation from IoT gateways to the cloud, for pub/sub services~\cite{7946415}. Specifically, they propose to develop pub/sub services that expose interfaces to set and retrieve the current state of the service, along with other functions, to let a hypervisor do the real-time migration of services from the gateway to the cloud. Even though the approach presented by Happ and Wolisz relates to our concept because it offloads computation to the gateway, our approach considers different conditions. On the one hand, our approach leverages the programming paradigm of Node-RED to simplify offloading computation. On the other hand, we offload complete jobs, thus making the process of offloading simple and consistent, i.e., no issues with synchronization of states.

\section{Rapid prototyping in the IoT gateway stack}
\label{sec:rapid}

Prototyping and development of IoT solutions have recently become accessible thanks to the availability of open hardware, software, and development kits for implementing devices (the Things in the IoT). Solutions also matured on the cloud side with PaaS resources and IoT specific cloud services readily available on the market.
Between the two, at the IoT gateway level, single board computer platforms (such as the Raspberry Pi family of boards) simplified development, but the complexity remained at the software side.

To address this lack of software frameworks at the gateway level, several initiatives started development of software stacks for IoT gateways, such as Eclipse Kura focusing on industrial use cases, Eclipse SmartHome targeting home automation, or the Linux Foundation's EdgeX Foundry focusing on the development of hardware and OS-agnostic framework for edge computing. Similar to these, AGILE also develops a software stack for IoT gateways, but its focus is to empower the gateway segment of the IoT architecture by utilizing its storage and computation resources and at the same time, to address challenges in rapid-prototyping of IoT applications.

The AGILE gateway software architecture supports the development, deployment, and execution of IoT applications directly on the gateway and facilitates the connection of these applications to things southbound and to cloud services northbound. AGILE provides a complete software stack for IoT gateways, supporting two main types of applications: i) full-fledged applications can be built using SDKs and installed on the gateway as Docker images; ii) rapid prototyping of applications using event-based visual code composition is embedded in the framework. In this paper, we focus on this second case and show how execution off-loading can be seamlessly integrated into this rapid-prototyping process to enable applications that can extend to cloud computing resources regardless of the underlying platform.

\section{Event-Based Visual Code Composition}
\label{sec:nodered}

Node-RED~\cite{nodered} provides an intuitive graphical interface to event-driven programs, also called  ``flows''. A Node-RED flow consists of several nodes interconnected by wires, where each node contains configurations, credentials or code. Messages are triggered by input nodes, e.g., sensors, and are passed and processed along the flow. Figure~\ref{fig:flow} depicts a simple Web server implemented in Node-RED. The first node ensures that when the flow is deployed, the Node-RED instance executing the flow listens for a particular URL. The node in the middle is a function node including the necessary JavaScript code to create a sample HTML page. The last node sends the HTTP response corresponding to the HTTP request triggering the node execution.
In addition to its simplicity, Node-RED offers high flexibility through a wide range of nodes for different abstractions and network layers: HTTP, MQTT, TCP, UDP...

Another interesting aspect of Node-RED is that it allows developers to separate their business logic into separate flows. In this way, users can split their code into different modules that interact with each other once they are deployed. This property is of utmost importance for our approach because in this paper we explore the impact of offloading particular flows to the cloud while keeping a simple ``shell'' flow running locally. In turn, the local flow interacts with flows deployed in the cloud taking care of the heavier computation.

\begin{figure}
\centering
\includegraphics[width=0.4\textwidth, trim = 0cm 0cm 0cm 0cm, clip=true]{flow-http.png}
\caption{Http server implemented as a Node-RED flow}
\label{fig:flow}
\end{figure}

\section{Dynamic Offloading of Computation}
\label{sec:offloading}

The computational capacity of IoT gateways can largely vary based on the hardware platform of choice, ranging from single-core passively cooled ARMv7 platforms with 512 MB of RAM to multi-core platforms with AMD64 processors and several GBs of RAM, and recently, with different GPU-based, image processing, or AI specific accelerators. When gateways are used for multiple purposes, the share of resources available to a single application can also vary depending on the long-term and instantaneous load generated by other services. Moreover, environmental factors, such as external temperature can also make computational capacity much more variable due to thermal limitations than what one can count on in temperature controlled data centers. These limits, however, also depend on the actual hardware configuration (e.g., extension shields), on the casing applied, or, in the case of fast prototyping, even on the quality of assembly.

At the same time, applications requiring relatively heavy computation are getting more traction in several verticals of IoT. E.g., home automation needs face and image recognition, industrial automation uses anomaly detection for the manufacturing process,  machinery needs predictive maintenance.

Our goal is to support the rapid-prototyping of such applications directly in Node-RED as part of the AGILE platform, and at the same time make sure that solutions are robust to variations in application load and operation conditions.

\paragraph{The Offloading Mechanism}
\label{sec:offloading-mechanism}

To support offloading as an integral part of rapid application development, we developed Node-RED extensions that facilitate programming and system deployment. At Node-RED level, the developer should first develop his application without dealing with offloading. The only change required is to identify the computationally intensive part of the application logic, by embedding it in a sub-flow, connected with so-called link nodes to the main flow. Once the flow is deployed, the selected part of the workflow is also automatically deployed on other computation nodes, and these remote instances get automatically connected to the original workflow. Therefore, we automatically get a modified workflow that enables both local and remote execution of the computationally intensive part. The modified workflow is visualized, and it is further tunable by the developer.  For this, we have developed two extensions to Node-RED:
\begin{itemize}
\item TabDeployer: this takes Node-RED flows as input, and automatically deploys selected parts of them in other Node-RED instances. The functionality is exposed in the development user interface, but it can also be triggered automatically. While deploying the remote flow, TabDeployer also rewrites the local flow to connect to the remote instance using the CloudLink node.
\item CloudLink: this node is responsible for redirecting execution to remote nodes if and when needed. It contains all the decision logic to determine whether execution could remain local or whether parameters should be sent to the remote instance. The node is also responsible for handling the communication with the remote Node-RED instance, hiding all the complexity from the developer. It currently uses HTTP for communication, while pub/sub (MQTT and Cote) support is being developed.
\end{itemize}

\paragraph{Making Offloading Dynamic}
\label{sec:offloading-dynamic}

In this paper, we focus on use cases where the scope of offloading is to guarantee system operation in case of sudden load peaks or other overload situations, e.g. due to background processes on the gateway.
In other words, offloading should only happen when local computational resources are scarce. When such offloading happens, service performance could be compromised due to communication delays, communication costs might occur, and cloud resources are being used that should be paid. However, execution goes on seamlessly, and temporary, as well as long-term, overload situations could be handled without service interruption. To achieve this, we have identified the following resources that are monitored, and which are used to make a local decision whether to offload the computation or not:
\begin{itemize}
\item memory utilization: the availability of memory resources on the common gateway platforms can be seen as a hard limit. Swapping to disk is mostly out of the question due to slow I/O leading to further overload, and thus should be avoided at all cost.
\item instantaneous CPU utilization: CPU utilization is an important indication that completion time will be compromised. However, its instantaneous version is susceptible to sudden peaks due to the operation of other background processes; therefore, it should be used with care, e.g., \ in combination with other metrics. CPU utilization can also be misleading due to dynamic frequency scaling (throttling) applied in under-load situations.
\item CPU temperature: temperature is also a good metric of longer-term CPU activity. Moreover, since temperature is also used to keep the platform's operation stable by throttling (reducing the speed of) the CPU, it can be used to keep the CPU at optimal operating conditions.
\item number of computation tasks currently in execution locally: finally, limiting the number of tasks executed locally can provide simple means to ensure that the local system is not overloaded. Tasks over the threshold could be delayed or offloaded, of which we study the latter case.
\end{itemize}

\section{Usage Example and Experimental Validation}
\label{sec:validation}

We study the offloading mechanism and decision rules on an example application based on image recognition, where we use the Tesseract library to extract text from images\footnote{All the code used for the experiments is available at https://github.com/Agile-IoT/nodered-rpi-offload/tree/cloudcom}. Whenever a new image is pushed to the application\footnote{to simplify the measurements we always use the same image}, processing starts and all text contained in the image is extracted.

We validate the offloading mechanism by first measuring the operational characteristics of a typical gateway platform under load when offloading is not enabled. Then, offloading is deployed, and we compare different off-loading strategies.

\paragraph{Gateway Performance Without Offloading}

Our experimental setup is composed of a passively cooled Raspberry Pi 3 model B with a quad-core ARM processor, 1GB of RAM, and a small heatsink, connected to an OpenStack cloud instance prepared to run the offloaded code segments.

\begin{figure}
\centering
\includegraphics[width=\columnwidth, trim = 0cm 0cm 0cm 0cm, clip=true]{graph2.png}
\includegraphics[width=\columnwidth, trim = 0cm 0cm 0cm 0cm, clip=true]{graph4.png}
\caption{Performance on Raspberry Pi without offloading}
\label{fig:pi}
\end{figure}

First, we characterize the performance of the gateway by running the application with constant load making sure 4 computationally intensive tasks (from now on jobs) are always running in parallel, i.e., starting 4 jobs and injecting a new job as soon as one is finished. During execution, we measure system metrics (memory utilization, CPU utilization, CPU temperature, CPU frequency), and job metrics (completion time, success ratio) in parallel. Fig.~\ref{fig:pi} shows the most important metrics as a function of time (top) and job ID (bottom).

As expected, CPU utilization is 100\% almost all the time as all four cores are loaded with jobs, and lower values are only present while jobs are resubmitted. Note how execution changes as the gateway heats up reaching limit temperatures where the system restricts CPU performance. In the first 170~s of execution, job duration fluctuates between 23 and 26~s due to other (random) background tasks in the OS. Performance degrades notably after about 170 seconds when the CPU reaches its limit temperature (80 \degree C). As CPU frequency is scaled down by the system, job durations gradually reach 29~s.

\paragraph{Offloading in Action}

\begin{table}[htbp]
 \centering
 \caption{performance with different offloading strategies}
 \label{tab:pi-perf}
 \setlength\tabcolsep{5pt} %
 \begin{tabular}{|l|l|l|p{.6cm}|    p{.94cm}|p{.94cm}|}
  \hline
  Name & Metric & Limit  & Local jobs (\%)  & Average duration (s) & Max. duration (s) \\
  \hline
  $Jobs_{4}$ & Jobs in execution & 4 & 70.0 & 26.5 & 31.7 \\
  \hline
  $CPU_{75\%}$ & CPU utilization & 75~\% & 62.5 & 19.1 & 20.7 \\
  \hline
  $Mem_{75\%}$ & Mem. utilization & 75~\% & 70.8 & 37.3 & 48.1 \\
  \hline
  $Temp_{75\degree}$ & Temperature & 75~{\degree}C & 53.3  & 20.5 & 39.2 \\
  \hline
 \end{tabular}
 \end{table}

\begin{figure}
\centering
\includegraphics[width=\columnwidth, trim = 0cm 0cm 0cm 0cm, clip=true]{plot6b.eps}
\caption{Local execution times with different offloading strategies. Dots connected with lines only to enhance visibility.}
\label{fig:pi-duration}
\end{figure}

In the following experiments, we compare different offloading strategies. We set up the system to receive a new task every 5 seconds (to simplify comparison we use constant inter-arrival times) and configure four different offloading strategies limiting i) the number of jobs running locally in parallel; ii) CPU utilization; iii) memory utilization; iv) CPU temperature. All other jobs are offloaded to the cloud. Table~\ref{tab:pi-perf} contains selected threshold parameters and statistics about these experiments, while Fig.~\ref{fig:pi-duration} compares the time series of job execution times in detail, explaining the rationale behind the statistics.

Starting our analysis from the ratio of locally executed jobs, which in turn determines how much cloud and communication resources should be paid for, there are clear differences between the strategies with the selected thresholds. $Jobs_{4}$ and $CPU_{75\%}$ reached 70\% local execution, while other strategies offloaded more jobs to the cloud. From the statistics, the execution times of local jobs (both average and max) seems to under control with the $CPU_{75\%}$ strategy.

Although the above statistics are interesting, the detailed Fig.~\ref{fig:pi-duration} explains more about the different behavior of these strategies.
Limiting the number of local jobs ($Jobs_{4}$) manages to limit execution times somewhat, although it does grow as the system heats up, reaching 30~s. $CPU_{75\%}$ behaves much better in this regard, although note that it only executed 62.5\% of jobs locally. $Mem_{75\%}$ behaves similar to ($Jobs_{4}$), reaching slightly higher offloading but also higher execution times. Interesting to note the periodicity of the control, more or less evident on each figure with different periods\footnote{we use time series from a single experiment here to provide more insight}. Temperature is regarded by many as an early indicator of system stress, and indeed $Temp_{75\degree}$ provides an excellent offloading strategy, apart from an initial transient where too many jobs were allowed in local execution and thus execution times extended.

\section{Conclusions}
\label{sec:conclusion}

Although single board computers are getting more and more powerful, offloading computation from IoT gateways to the cloud is necessary in several use cases and under various operating conditions to provide robust solutions at the edge. We have integrated offloading of computation tasks as part of our rapid prototyping workflow, and shown how it can dynamically handle demand keeping the gateway under load but offloading excess tasks. Our analysis of various offloading criteria revealed interesting differences in the service levels each one could provide. An extended study of multi-criteria decisions to provide service level agreement guarantees is still future work.

\bibliographystyle{IEEEtran}


\section{Introduction}\label{sec_introduction}
Recent technology advances have enabled firms to flexibly process and analyze sophisticated employee performance data at a reduced and yet significant cost.  Speech analytics software, natural language processing tools and cloud-based systems are increasingly used to convert hard-to-process contents into succinct and meaningful ratings such as ``satisfactory'' and ``unsatisfactory'' (\cite{nlp}; \cite{nytimes}; \cite{harper}). This paper develops a theory of optimal incentive contracting where the \emph{monitoring technology} that governs the above procedure is part of the designer's strategic planning.

Our research agenda is motivated by the case of call center performance management reported by \cite{nytimes}. It has long been recognized that the conversations between call center agents and customers contain useful performance indicators such as customer sentiment, voice quality and tone, etc.. Recently, the advent of speech analytics software has finally enabled the processing and analysis of these contents, as well as their conversions into meaningful ratings such as ``satisfactory'' and  ``unsatisfactory.'' On the one hand, running speech analytics software consumes server space and power, and the procedure has been increasingly outsourced to third parties to take advantage of the latest development in cloud computing. On the other hand, managers now have considerable freedom to decide which facets of the customer conversation to utilize, thanks to the increased availability of products whose specialties range from emotion detection to word spotting.

We formalize the flexibility and cost associated with the design and implementation of the monitoring technology in otherwise standard principal-agent models with moral hazard. Specifically, we allow the monitoring technology to partition agents' performance data into any finite categories, at a cost that increases with the amount of information the output signal carries  (hereafter \emph{monitoring cost}). An incentive contract pairs the monitoring technology with a wage scheme that maps realizations of the output signal to different wages. An optimal contract minimizes the sum of expected wage and monitoring cost, subject to agents' incentive constraints.

Our main result gives characterizations of optimal monitoring technologies in general environments, showing that the assignment of Lagrange multiplier-weighted likelihood ratios to performance categories is positive assortative in the direction of agent utilities. Geometrically, this means that optimal monitoring technologies comprise convex cells in the space of likelihood ratios or their transformations. This result provides practitioners with the needed formula for sorting employee performance data, and exploiting its geometry yields insights into workforce management and firms' internal organizations.

Our proof strategy works directly with the principal's Lagrangian. It handles general situations featuring multiple agents and tasks, in which the direction of sorting vector-valued likelihood ratios is nonobvious a priori. It overcomes the technical challenge whereby perturbations of the sorting algorithm affect wages endogenously through the Lagrange multipliers of agents' incentive constraints, yielding effects that are new and difficult to assess using standard methods.

We give three applications of our result. In the single-agent model considered in \cite{holmstrom}, we show that the assignment of likelihood ratios to wage categories is positive assortative and follows a simple cutoff rule. The monitoring technology aggregates potentially high-dimensional performance data into rank-ordered ratings, and the output signal satisfies the strict monotone likelihood ratio property with respect to the order induced by likelihood ratios. Solving cutoff likelihood ratios yields consistent findings with recent developments in manufacturing, retail and healthcare sectors, where decreases in the data processing cost have shown to increase the fineness of the performance grids (\cite{bloomvanreenenwp}; \cite{nlp}; \cite{mckinsey}).

In the multi-agent model considered in \cite{holmstromteam}, the optimal monitoring technology partitions vectors of individual agents' likelihood ratios into convex polygons. Based on this result, we then compare individual and group performance evaluations from the angle of monitoring cost, showing that firms should switch from individual to group evaluation in response to rising monitoring costs. This result formalizes the theses of \cite{ad} and \cite{lazearrosen} that either team or tournament should be the dominant incentive system when individual performance evaluation is too costly to conduct. It is consistent with the findings of \cite{bloomvanreenenwp} that lack of IT access increases the use of group performance evaluation among otherwise similar firms.

In the multiple-task model studied in \cite{holmstrommilgrom}, the resources spent on the assessment of a task performance should increase with the agent's endogenous tendency to shirk the corresponding task. Using simulation, we apply this result to the study of, e.g.,
how improved precision of some task measurements (caused by, e.g., the advent of high-quality scanner data measuring the skillfulness in scanning items) would affect the resources spent on the assessments of other task performances (e.g., projecting warmth to customers).

\subsection{Related Literature}\label{sec_literature}
Earlier studies on contracting with costly experiments (in the sense of \cite{blackwell}) include, but are not limited to: \cite{baimandemski} and \cite{dye2}, in which the principal can pay an external auditor for drawing a signal from an exogenous distribution; \cite{holmstrom}, \cite{grossmanhart} and \cite{kim}, in which signal distributions are ranked based on the incentive costs they incur. In these studies, the principal can change the probability space generated by the agent's hidden effort and, in the first two studies, through paying stylized costs. In contrast, we focus on the conversion of raw data into performance ratings while taking the probability space as given. Also our assumption that the monitoring cost increases with the amount of information carried by the output signal could be ill-suited for modeling the cost of running experiments.

The current work differs from existing studies on rational inattention (hereafter RI) in three aspects. First, early developments in RI by \cite{sims}, \cite{riprice} and \cite{woodford} sought to explain the stickiness of macroeconomic variables by information processing costs, whereas we examine the implication of costly yet flexible monitoring for principal-agent relationships.\footnote{\cite{yang} studies a security design problem where a rationally inattentive buyer can obtain any signal about the uncertain fundamental at a cost that is proportional to entropy reduction. Other recent efforts to introduce RI into strategic environments include but are not limited to: \cite{riconsumer}, \cite{martin} and \cite{ravid}.} Second, we focus mainly on partitional monitoring technologies because in reality, adding non-performance-related factors into employee ratings could have dire consequences such as appeals, lawsuits and excessive turnover.\footnote{See standard HR textbooks for this subject matter. \cite{saintpaul} demonstrates the validity of entropy as an information cost in  decision problems where the decision variable is a deterministic function of the exogenous state variable. } Finally, our monitoring cost function nests entropy as a special case.

Recent works of \cite{cremeretal}, \cite{voronoi}, \cite{sobel} and \cite{dilme} examine the optimal language used between organization members who share a common interest but face communication costs. The absence of conflicting interests hence incentive constraints distinguishes these works from ours.

\bigskip

The remainder of this paper is organized as follows: Section \ref{sec_baseline} introduces the baseline model; Section \ref{sec_analysis} presents main results; Sections \ref{sec_multiagent} and \ref{sec_multidev} investigate extensions of the baseline model; Section \ref{sec_conclusion} concludes. See Appendices \ref{sec_proof} and \ref{sec_online} for omitted proofs and additional materials.

\section{Baseline Model}\label{sec_baseline}
\subsection{Setup}\label{sec_setup}
\paragraph{Primitives} A risk-neutral principal faces a risk-averse agent, who  earns a utility $u\left(w\right)$ from spending a nonnegative wage $w \geq 0$ and incurs a cost $c\left(a\right)$ from privately exerting high or low effort $a \in \{0,1\}$. The function $u: \mathbb{R}_+ \rightarrow \mathbb{R}$ satisfies $u\left(0\right)=0$, $u'>0$ and $u''<0$, whereas $c\left(1\right)=c>c\left(0\right)=0$.

Each effort choice $a$ generates a probability space $\left(\Omega, \Sigma, P_a\right)$, where $\Omega$ is a finite-dimensional Euclidean space that comprises the agent's performance data, $\Sigma$ is the Borel sigma-algebra on $\Omega$, and $P_a$ is the probability measure on $\left(\Omega, \Sigma\right)$. $P_a$'s are assumed to be mutually absolutely continuous, and the probability density function $p_a$'s they induce are well-defined and everywhere positive.

\paragraph{Incentive contract}  An incentive contract $\langle \mathcal{P}, w\left(\cdot\right) \rangle$ is a pair of \emph{monitoring technology} $\mathcal{P}$ and \emph{wage scheme} $w: \mathcal{P} \rightarrow \mathbb{R}_{+}$. The former represents a human- or machine-operated system that governs the processing and analysis of performance data, whereas the latter maps outputs of the first-step procedure to different levels of wages. In the main body of this paper, $\mathcal{P}$ can be any partition of $\Omega$ with at most $K$ cells that are all of positive measures,\footnote{In Appendix \ref{sec_random}, we allow the monitoring technology to be any mapping from $\Omega$ to lotteries on finite performance categories. If the lottery is degenerate, then the monitoring technology is partitional.} and $w: \mathcal{P} \rightarrow \mathbb{R}_{+}$ maps each cell $A$ of $\mathcal{P}$ to a nonnegative wage $w\left(A\right) \geq 0$.\footnote{Appendix \ref{sec_ir} examines the case where the agent is constrained by individual rationality.  } The upper bound $K$ for the \emph{rating scale} $|\mathcal{P}|$ can be any integer greater than one and will be taken as given throughout the analysis.\footnote{The upper bound $K$, while stylized, guarantees the existence of optimal incentive contract(s). Judging from the simulation exercises we have so far conducted, the optimal rating scale is typically smaller than $K$ even when $\mu$ is small (see, e.g., Figure \ref{figure_ratingscale}).}

For any data point $\omega \in \Omega$, let $A\left(\omega\right)$ be the unique \emph{performance category} that contains $\omega$ and let $w\left(A\left(\omega\right)\right)$ be the wage associated with $A\left(\omega\right)$. Time evolves as follows:
\begin{enumerate}
\item the principal commits to $\langle \mathcal{P}, w\left(\cdot\right)\rangle$;
\item the agent privately chooses $a \in \left\{0,1\right\}$;
\item Nature draws $\omega$ from $\Omega$ according to $P_a$;
\item the monitoring technology outputs $A\left(\omega\right)$;
\item the principal pays $w\left(A\left(\omega \right)\right)$ to the agent.
\end{enumerate}

\paragraph{Implementation cost} For any given effort choice $a$ by the agent, a monitoring technology $\mathcal{P}=\left\{A_1,\cdots, A_N\right\}$ outputs a signal $X: \Omega \rightarrow \mathcal{P}$ whose probability distribution is represented by a vector $\bm{\pi}\left(\mathcal{P},a\right)=\left(P_a\left(A_1\right),\cdots, P_a\left(A_N\right), 0,\cdots, 0\right)$ in the $K$-dimensional simplex. The principal incurs the following cost from implementing an incentive contract $\langle \mathcal{P}, w\left(\cdot\right) \rangle$:
\[
\sum_{A \in \mathcal{P}} P_a
\left(A
\right)w\left(A\right)+ \mu \cdot H\left(\mathcal{P}, a\right),
\]
which consists of two parts. The first part $\sum_{A \in \mathcal{P}} P_a\left(A\right)w\left(A\right)$, i.e., the \emph{incentive cost}, has been the central focus of the existing principal-agent literature. The second part $\mu \cdot H\left(\mathcal{P}, a\right)$, hereafter termed the \emph{monitoring cost},  represents the cost associated with the processing and analysis of the performance data. In particular, $\mu>0$ is an exogenous parameter which we will further discuss in Section \ref{sec_implication}, whereas $H\left(\mathcal{P},a\right)$ captures the amount of information carried by the output signal and is assumed to satisfy the following properties:

\begin{assm}\label{assm_mc}
There exists a function $h: \Delta^K \rightarrow \mathbb{R}_+$ such that $H\left(\mathcal{P}, a\right)=h\left(\bm{\pi}\left(\mathcal{P},a\right)\right)$ for all  $\left(\mathcal{P}, a\right)$. Furthermore,
\begin{enumerate}[(a)]
\item $h\left(\pi_1, \cdots, \pi_K\right)=h\left(\pi_{\sigma\left(1\right)}, \cdots, \pi_{\sigma\left(K\right)}\right)$ for all probability vector $\left(\pi_1,\cdots, \pi_K\right) \in \Delta^K$ and permutation $\sigma$ on $\left\{1,\cdots, K\right\}$;
\item $h\left(0, \pi_2, \cdots\right)<h\left(\pi_1', \pi_2'', \cdots\right)$ for all $\left(0, \pi_2, \cdots\right)$ and $\left(\pi_1', \pi_2', \cdots\right) \in \Delta^K$ that differ only in the first two elements and satisfy $\pi_2, \pi_1', \pi_2'>0$ and $\pi_2=\pi_1'+\pi_2'$.
\end{enumerate}
\end{assm}

Inspired by basic principles of information theory, Assumption \ref{assm_mc} stipulates that the amount of information carried by the output signal should depend only on the latter's probability distribution and must increase with the fineness of the monitoring technology. Aside from probabilities, nothing else matters, not even the naming or contents of the performance categories. Assumption \ref{assm_mc} is satisfied by, e.g., the entropy $- \sum_{A \in \mathcal{P}} P_a\left(A\right) \log_2 P_a\left(A\right)$ of the output signal and the bits of information $\log_2|\mathcal{P}|$ it carries.\footnote{The bit is a basic unit of information in information theory, computing, and digital communications. In information theory, one bit is defined as the maximum information entropy of a binary random variable.} In Section \ref{sec_cost}, we motivate the use of this assumption in the example of call center performance management.

\paragraph{The principal's problem}  Consider the problem of inducing high effort from the agent.\footnote{The problem of inducing low effort is standard.} Define a random variable $Z: \Omega \rightarrow \mathbb{R}$ by
\[
Z\left(\omega\right)=1-\frac{p_0\left(\omega\right)}{p_1\left(\omega\right)} \text{ } \text{ }\forall \omega,
\]
where $p_0\left(\omega\right)/p_1\left(\omega\right)$ is the \emph{likelihood ratio} associated with data point $\omega$. Note that $\mathbf{E}\left[Z \mid a=1\right]=0$ and that the range of $Z$ is a subset of $\left(-\infty, -1\right)$. For any set $A \in \Sigma$ of positive measure, define the \emph{$z$-value} of $A$ by
\[
z(A)=\mathbf{E}\left[Z \mid A; a=1\right].
\]
In words, $z\left(A\right)$ represents the average value of $Z$ conditional on the data point being drawn from $A$.

A contract $\langle \mathcal{P}, w\left(\cdot\right)\rangle$ is incentive compatible if
\[
\sum_{A \in \mathcal{P}} P_1\left(A\right)u\left(w\left(A\right)\right)- c \geq \sum_{A \in \mathcal{P}} P_0\left(A\right)u\left(w\left(A\right)\right)
\]
or, equivalently,
\begin{equation}
\tag{IC} \sum_{A \in \mathcal{P}} P_1\left(A\right)u\left(w\left(A\right)\right)z\left(A\right) \geq c, \label{eqn_ic}
\end{equation}
and it satisfies the limited liability constraint if
\begin{equation}
\tag{LL}  w\left(A\right) \geq 0 \text{ } \forall A \in \mathcal{P}. \label{eqn_ll}
\end{equation}
An optimal incentive contract that induces high effort from the agent (optimal incentive contract for short) minimizes the total implementation cost under high effort, subject to the incentive compatibility constraint and limited liability constraint:
\[
\min_{\langle \mathcal{P}, w\left(\cdot\right)\rangle} \sum_{A \in \mathcal{P}} P_1\left(A\right)w\left(A\right)+\mu \cdot H\left(\mathcal{P}, 1\right) \text{ s.t. (\ref{eqn_ic}) and (\ref{eqn_ll})}.
\]
In what follows, we will denote the solution(s) to the above problem by $\langle \mathcal{P}^*, w^*\left(\cdot\right)\rangle$.

\subsection{Monitoring Cost}\label{sec_cost}
We first illustrate Assumption \ref{assm_mc} in the context of call center performance management:

\begin{example}[label=exa:cont1]
In the example described in Section \ref{sec_introduction}, a piece of performance data comprises the major characteristics of a call history (e.g., customer sentiment and voice quality) encoded in binary digits, and the  monitoring technology represents the speech analytics program that categorizes binary digits into performance ratings. To formalize the design flexibility, we allow the monitoring technology to partition performance data into any $N \leq K$ categories, where $K$ can be any interger greater than one. The cost of  running the monitoring technology is assumed to increase with the amount of processed information, whose definition varies from case to case. For example, if the monitoring technology runs many times among many identical agents, then the optimal design should minimize the average steps it takes to find the performance category containing the raw data point. By now, it is well known that this quantity equals approximately the entropy of the output signal. In contrast, if the monitoring technology runs only a few times for a few number of agents, then the worst-case (or unamortized) amount of processed information is best captured by the bits of information carried by the output signal (see, e.g., \cite{infortheory}). In both cases, the quantity of our interest  depends only on the probability distribution of the output signal and nothing else.
\end{example}

We next introduce the concept of \emph{setup cost} and distinguish it from our  notion of monitoring cost:

\begin{example}[continues=exa:cont1]
As its name suggests, \emph{setup cost} refers the cost incurred to set up the infrastructure that facilitates data processing and analysis, e.g., Fast Fourier Transformation (FFT) chips (which transform sound waves into their major characteristics coded in binary digits), recording devices, etc..

The major role of setup cost is to change the probability space $\left(\Omega, \Sigma, P_a\right)$. For example, design improvements in FFT chips enable more frequent sampling of sound waves and cause $\left(\Omega, \Sigma, P_a\right)$ to change. In what follows, we will take the probability space as given and ignore the setup cost. That said, one can certainly embed our analysis into a two-stage setting in which the principal first incurs the setup cost and then the monitoring cost. Results below will carry over to this new setting.
\end{example}

\section{Analysis}\label{sec_analysis}
\subsection{Preview}\label{sec_preview}
\begin{example}\label{exm_main}
Suppose $u\left(w\right)=\sqrt{w}$, $Z$ is uniformly distributed over $\left[-1/2, 1/2\right]$ under $a=1$ and $H\left(\mathcal{P},a\right)=f\left(|\mathcal{P}|\right)$ for some strictly increasing function $f: \left\{1,\cdots, K \right\} \rightarrow \mathbb{R}_+$. Below we walk through the key steps in  solving the optimal incentive contract, give closed-form solutions and discuss their practical implications.

\paragraph{Optimal wage scheme} We first solve for the optimal wage scheme for any given monitoring technology $\mathcal{P}$ as in \cite{holmstrom}. Specifically, label the performance categories as $A_1, \cdots, A_N$, and write $\pi_n=P_1\left(A_n\right)$ and $z_n=z\left(A_n\right)$ for $n=1,\cdots, N$. Assume $z_j \neq z_k$ for some $j, k \in \left\{1,\cdots, N\right\}$ to make the analysis interesting.  The principal's problem is then
\begin{align*}
\min_{\left\{w_n\right\}} & \sum_{n=1}^N \pi_n w_n,\\
\tag{IC} \text{ s.t. } & \sum_{n=1}^N \pi_n \sqrt{w_n} z_n \geq c,\\
\tag{LL}\text{ and } & w_n \geq 0, n=1,\cdots, N.
\end{align*}
Straightforward algebra yields the expression for minimal incentive cost:
\begin{equation*}
c^2\left(\sum_{n=1}^N \pi_n \max\left\{0, z_n\right\}^2\right)^{-1}. \label{eqn_incentive_cost}
\end{equation*}
A close inspection reveals Holmstr\"{o}m's (1979) \emph{sufficient statistics principle}, namely $z$-value is the only part of the performance data that provides the agent with incentives.

\paragraph{Optimal monitoring technology} We next solve for the optimal monitoring technology. First, note that the principal should partition performance data based only on their $z$-values, and that different  performance categories must attain different $z$-values and wages. The reason combines the sufficient statistic principle with  Assumption \ref{assm_mc}(b), namely merging performance categories of the same $z$-value saves the monitoring cost while leaving the incentive cost unaffected and thus constitutes an improvement to the original monitoring technology.

A more interesting question concerns how we should assign the various data points, identified by their $z$-values, to different performance categories. In the baseline model featuring a single agent and binary efforts, the answer to this question is relatively straightforward: assign high (resp. low) $z$-values to high-wage (resp. low-wage) categories. Here is a quick proof of this result: since the left-hand side of the (\ref{eqn_ic}) constraint is supermodular in wages and $z$-values, if our conjecture were false, then reshuffling data points as above while holding the probabilities of performance categories constant reduces the incentive cost while leaving the monitoring cost unaffected

When extending the above intuition to general settings featuring multiple agents or multiple actions, we face two challenges. First, in the case where $z$-values and wages are vectors, the direction of sorting these objects is nonobvious a priori. Second, changes in the sorting algorithm affect wages endogenously through the Lagrange multipliers of the incentive constraints, yielding effects that are new and difficult to assess using standard methods.

The proof strategy presented in Section \ref{sec_proofsketch} overcomes these challenges, showing that the assignment of Lagrange multiplier-weighted $z$-values to performance categories must be positive assortative in the direction of agent utilities. Geometrically, this means that any optimal monitoring technology must comprise convex cells in the space of $z$-values or their transformations. Theorems \ref{thm_main}, \ref{thm_multiagent} and \ref{thm_multidev} formalize the above statements.

\paragraph{Implications}  An important feature of the optimal monitoring technology is \emph{information aggregation}---a term used by human resource practitioners to refer to the aggregation of potentially high-dimensional performance data into rank-ordered ratings such as ``satisfactory'' and ``unsatisfactory.''

The geometry of the optimal monitoring technology sheds light on the practical issues covered in Sections \ref{sec_implication}, \ref{sec_multiagent_application} and \ref{sec_multitask_application}. Consider, for example, optimal performance grids. In the current example, it can be shown that the optimal $N$-partitional monitoring technology divides the space $\left[-1/2, 1/2\right]$ of $z$-values into $N$ disjoint intervals $[\widehat{z}_{n-1}, \widehat{z}_n)$, $n=1,\cdots, N$, where $\widehat{z}_0=-1/2$ and $\widehat{z}_N=1/2$. The optimal cut points $\left\{\widehat{z}_n\right\}_{n=1}^{N-1}$ can be solved as follows:
\[\min_{\left\{\widehat{z}_n\right\}} c^2\left(\sum_{n=1}^N \pi_{n} \max\{0, z_{n}\}^2\right)^{-1} - \mu \cdot f\left(N\right),\]
where
\[\pi_{n}=\int_{\widehat{z}_{n-1}}^{\widehat{z}_{n}}  dZ =\widehat{z}_{n}-\widehat{z}_{n-1},\]
and
\[
z_{n}=\frac{1}{\pi_{n}}\int_{\widehat{z}_{n-1}}^{\widehat{z}_{n}} Z dZ=\frac{1}{2}\left(\widehat{z}_{n-1}+\widehat{z}_{n}\right).\]
Straightforward algebra yields
\[\widehat{z}_{n}=\frac{2n-1}{4N-2}, \text{ } n=1,\cdots, N-1.\]
Based on this result, as well as the functional form of $f$, we can then solve for  the optimal rating scale $N$ and hence the optimal incentive contract completely.
\end{example}

\subsection{Main Results}\label{sec_main}
This section analyzes optimal incentive contracts. Results below hold true except perhaps on a measure zero set of data points. The same disclaimer applies to the remainder of this paper.

We first define \emph{$Z$-convexity}:

\begin{defn}\label{defn_zconvex}
A set $A \in \Sigma$ is \emph{$Z$-convex} if the following holds for all $\omega',\omega'' \in A$ such that $Z\left(\omega'\right) \neq Z\left(\omega''\right)$:
\[
\left\{\omega \in \Omega: Z\left(\omega\right)=\left(1-s\right) \cdot Z\left(\omega'\right)+s \cdot Z\left(\omega''\right) \text{ for some } s \in \left(0,1\right)\right\} \subset A.
\]
\end{defn}

In words, a set $A \in \Sigma$ is $Z$-convex if whenever it contains data points of different $z$-values, it must also contain all data points of intermediate $z$-values. Let $Z\left(A\right)$ denote the image of any set $A \in \Sigma$ under mapping $Z$. In the case where $Z\left(\Omega\right)$ is a connected set in $\mathbb{R}$, the above definition is equivalent to the convexity of $Z\left(A\right)$ in $\mathbb{R}$.

A few assumptions before we go into detail. The next assumption says that the distribution of $Z$ has no atom or hole:

\begin{assm}\label{assm_regular}
$Z$ is distributed atomlessly on a connected set $Z\left(\Omega\right)$ in $\mathbb{R}$ under $a=1$.
\end{assm}

The next assumption says that $Z\left(\Omega\right)$ is compact set in $\mathbb{R}$:
\begin{assm}\label{assm_compact}
$Z\left(\Omega\right)$ is a compact set in $\mathbb{R}$.
\end{assm}

The next assumption imposes regularities on the monitoring cost function: Part (a) of it holds for the bits of information carried by the output signal, and Part (b) of it holds for the entropy of the output signal:

\begin{assm}\label{assm_cf}
The function $h: \Delta^K \rightarrow \mathbb{R}_+$ satisfies one of the following conditions:
\begin{enumerate}[(a)]
\item $h\left(\bm{\pi}\left(\mathcal{P},a\right)\right)=f\left(|\mathcal{P}|\right)$ for some strictly increasing function $f: \left\{1,\cdots, K\right\} \rightarrow \mathbb{R}_+$;
\item $h$ is continuous.
\end{enumerate}
\end{assm}

We now state our main results. The next theorem shows that any optimal incentive contract assigns data points of high (resp. low) $z$-values to high-wage (resp. low-wage) categories. Under Assumption \ref{assm_regular}, this can be achieved by first dividing $z$-values into disjoint intervals and then backing out the partition of the original data space accordingly. The result is an aggregation of potentially high-dimensional data into rank-ordered ratings, as well as a wage scheme that is strictly increasing in these ratings:

\begin{thm}\label{thm_main}
Assume Assumption \ref{assm_mc} and let $\langle \mathcal{P}^*, w^*\left(\cdot\right)\rangle$ be any optimal incentive contract that induces high effort from the agent. Then $\mathcal{P}^*$ comprises $Z$-convex cells labeled as $A_1,\cdots, A_N$ where $0=w^*\left(A_1\right)<\cdots<w^*\left(A_N\right)$. Assume, in addition, Assumption \ref{assm_regular}. Then there exist $\inf Z\left(\Omega\right)= \widehat{z}_0< \widehat{z}_1 < \cdots< \widehat{z}_N = \sup Z(\Omega)$ such that $A_n =\left\{\omega: Z\left(\omega\right) \in \left[\widehat{z}_{n-1}, \widehat{z}_{n}\right)\right\}$ for $n=1,\cdots, N$.\footnote{Under Assumption \ref{assm_regular}, the set of (finite) cut points has measure zero, so it is unimportant which of the two adjacent intervals a cut point belongs to. The choice of expressing all intervals as right half-open ones is purely aesthetic.}
\end{thm}

The next theorem proves existence of optimal incentive contract:

\begin{thm}\label{thm_exist}
An optimal incentive contract that induces high effort from the agent exists under Assumptions \ref{assm_mc}-\ref{assm_cf}.
\end{thm}

\begin{proof}
See Appendix \ref{sec_proof_baseline}.
\end{proof}

\subsection{Proof Sketch}\label{sec_proofsketch}
The proof of Theorem \ref{thm_main} consists of three steps. The intuitions of steps one and two have already been discussed in Example \ref{exm_main}. Step three is new.

\paragraph{Step one} We first take any monitoring technology $\mathcal{P}$ as given and solve for the optimal wage scheme as in \cite{holmstrom}:
\begin{equation}
\min_{w: \mathcal{P} \rightarrow \mathbb{R}_{+}}\sum_{A \in \mathcal{P}} P_1\left(A\right)w\left(A\right) \text{ s.t.  (\ref{eqn_ic}) and (\ref{eqn_ll}).} \label{eqn_reducedproblem}
\end{equation}
The next lemma restates Holmstr\"{o}m's (1979) \emph{sufficient statistic principle}:
\begin{lem}\label{lem_foc}
Let $w^*\left(\cdot; \mathcal{P}\right)$ be any solution to Problem  (\ref{eqn_reducedproblem}). Then there exists $\lambda>0$ such that $u'\left(w^*\left(A; \mathcal{P}\right)\right)=1/\left(\lambda z\left(A\right)\right)$ for all $A \in \mathcal{P}$ such that $w^*\left(A; \mathcal{P}\right)>0$.
\end{lem}

\begin{proof}
See Appendix \ref{sec_proof_baseline}.
\end{proof}

\paragraph{Step two} We next demonstrate that different performance categories must attain different $z$-values and wages:

\begin{lem}\label{lem_mlrp}
Assume Assumption \ref{assm_mc}. Let $\langle \mathcal{P}^*, w^*\left(\cdot\right) \rangle$ be any optimal incentive contract that induces high effort from the agent and label the cells of $\mathcal{P}^*$ as $A_1,\cdots, A_N$ such that $z\left(A_1\right)\leq \cdots \leq z\left(A_N\right)$. Then $z\left(A_1\right)<0<\cdots<z\left(A_N\right)$ and $0=w^*\left(A_1\right)<\cdots<w^*\left(A_N\right)$.
\end{lem}

\begin{proof}
See Appendix \ref{sec_proof_baseline}.
\end{proof}

\paragraph{Step three} We finally demonstrate that the assignment of $z$-values into wage categories is positive assortative. In Example \ref{exm_main}, we sketched a proof based on supermodularity and pointed out the difficulties of extending that argument to multidimensional environments.  The argument below overcomes these difficulties.

Take any optimal incentive contract with distinct performance categories $A_j$ and $A_k$. From Lemma \ref{lem_mlrp}, we know that $z\left(A_j\right)\neq z\left(A_k\right)$. Fix any $\epsilon>0$, and take any $A'_\epsilon\subset A_j$ and $A''_{\epsilon}\subset A_k$ such that $P_1\left(A'_\epsilon\right)=P_1\left(A''_\epsilon\right)=\epsilon$ and $z\left(A'_\epsilon\right)=z' \neq z\left(A''_\epsilon\right)=z''$. In words,  $A'_\epsilon$ and $A''_\epsilon$ have the same probability $\epsilon$ under $a=1$ but different $z$-values that are independent of $\epsilon$. Lemma \ref{lem_smallSet} of Appendix \ref{sec_proof_baseline_lemma} proves existence of $A'_\epsilon$ and $A''_\epsilon$ when $\epsilon$ is small.

Consider a perturbation to the monitoring technology that ``swaps'' $A'_\epsilon$ and $A''_\epsilon$. Post the perturbation, the new performance categories, denoted by $A_n\left(\epsilon\right)$'s, become $A_j\left(\epsilon\right)=\left(A_j \backslash A'_\epsilon\right)\cup A''_\epsilon$, $A_k\left(\epsilon\right)=\left(A_k \backslash A''_\epsilon\right)\cup A'_\epsilon$ and $A_n\left(\epsilon\right) =A_n$ for $n \neq j,k$. Since the perturbation has no effect on the probabilities of the performance categories under $a=1$, it does not affect the monitoring cost by Assumption \ref{assm_mc}(a). Meanwhile, it changes the principal's Lagrangian to the following (ignore the (\ref{eqn_ll}) constraint):
\[
\mathcal{L}\left(\epsilon\right)=\sum_{n} \pi_n \left(w_n\left(\epsilon\right)-\lambda(\epsilon)u\left(w_n\left(\epsilon\right)\right)z_n \right)+\lambda\left(\epsilon\right)c,
\]
where $\pi_n$ denotes the probability of $A_n$ (equivalently $A_n\left(\epsilon\right)$) under $a=1$, $w_n\left(\epsilon\right)$ the optimal wage at $A_n\left(\epsilon\right)$, and $\lambda\left(\epsilon\right)$ the Lagrange multiplier associated with the (\ref{eqn_ic}) constraint. A close inspection of the Lagrangian leads to the following conjecture: to minimize $\mathcal{L}\left(\epsilon\right)$, the assignment of Lagrange multiplier-weighted $z$-values to performance categories must be positive assortative in the direction of agent utilities.

To develop intuition, we assume differentiability and obtain
\begin{align*}
\mathcal{L}'\left(0
\right)=&\sum_{n} \pi_n w'_n\left(0\right)-\lambda'\left(0\right)\underbrace{\left(\sum_{n} \pi_n u\left(w_n\left(0\right)\right) z_n\left(0\right)-c\right)}_\text{\quad \quad \text{ } $(1)$\quad$=0$}\\
&-\lambda(0)\left(\sum_{n} \pi_n  \cdot \underbrace{u'\left(w_n\left(0\right)\right) z_n\left(0\right)}_\text{\quad \quad \quad \quad \quad \text{ } $(2)$\quad $=1/\lambda(0)$} \cdot {w'_n}\left(0\right)+\sum_{n} \pi_n u\left(w_n\left(0\right)\right) z'_n\left(0\right)\right)\\
=&\sum_{n} \pi_n w'_n\left(0\right)-0-\sum_{n} \pi_n w'_n\left(0\right)-\lambda\left(0\right)\sum_{n} \pi_n u\left(w_n\left(0\right)\right) z'_n\left(0\right)\\
=&-\lambda\left(0\right)\sum_{n} \pi_n u\left(w_n\left(0\right)\right) z'_n\left(0\right)\\
= &\text{ } \lambda\left(0\right)\left(z''-z'\right)\left(u\left(w_k\left(0\right)\right)-u\left(w_j\left(0\right)\right)\right).
\end{align*}
In the above expression, $(1)=0$ because the (\ref{eqn_ic}) constraint binds under the original contract, and $(2)=1/\lambda\left(0\right)$ by Lemma \ref{lem_foc}. These findings resolve our concerns raised in Section \ref{sec_preview}, showing that the effects of our perturbation on the Lagrange multiplier and wages are negligible.

To complete the proof, note that $\mathcal{L}'\left(0\right) \geq 0$ by optimality, and that $\mathcal{L}'\left(0\right) \neq 0$ because $\lambda\left(0\right)>0$, $z'' \neq z'$ and $w_j\left(0\right)\neq w_k\left(0\right)$ (Lemma \ref{lem_mlrp}). Combining yields $\mathcal{L}'\left(0\right)>0$, so our conjecture is indeed true. $Z$-convexity is immediate: if a performance category contains extreme but not intermediate $z$-values, then the assignment of $z$-values goes in the wrong direction and an improvement can be constructed.

The above proof strategy yields the endogenous direction of sorting raw data into performance categories, which is relatively straightforward in the baseline model but is less so in later extensions. The proof in Appendix \ref{sec_proof_baseline} does not assume differentiability and handles the limited liability constraint, too.

\subsection{Implications}\label{sec_implication}
\paragraph{Strict MLRP} Theorem \ref{thm_main} implies that the signal generated by any optimal monitoring technology must satisfy the strict monotone likelihood ratio property (hereafter \emph{strict MLRP}) with respect to the order induced by $z$-values:

\begin{defn}
For any $A, A' \in \Sigma$ of positive measures, write $A \overset{z}{\preceq} A'$ if $z\left(A\right) \leq z\left(A'\right)$.
\end{defn}

\begin{cor}\label{cor_mlrp}
The signal $X: \Omega \rightarrow \mathcal{P}^*$ generated by any optimal monitoring technology $\mathcal{P}^*$ satisfies strict MLRP with respect to $\overset{z}{\preceq}$, i.e., any $A, A' \in \mathcal{P}^*$ satisfy $A \overset{z}{\preceq} A'$ if and only if $z\left(A\right) < z\left(A'\right)$.
\end{cor}

While the signal generated by any monitoring technology trivially satisfies the weak MLRP with respect to $\overset{z}{\preceq}$ (i.e., replace ``$<$'' with ``$\leq$'' in Corollary \ref{cor_mlrp}), it violates the strict MLRP if there are multiple performance categories that attain the same $z$-value. By contrast, the signal generated by any optimal monitoring technology must satisfy the strict MLRP with respect to $\overset{z}{\preceq}$, because merging performance categories of the same $z$-value saves the monitoring cost while leaving the incentive cost unaffected.

\paragraph{Comparative statics} The parameter $\mu$ captures factors that affect the (opportunity) cost of data processing and analysis. Factors that reduce $\mu$ include, but are not limited to: the advent of IT-based HR management systems in the 90's, advancements in speech analytics, increases in computing power, etc..

To facilitate comparative statics analysis, we write any choice of optimal incentive contract as $\langle \mathcal{P}^*(\mu), w^*(\cdot; \mu) \rangle$ to make its dependence on $\mu$ explicit:

\begin{prop}\label{prop_mu}
Fix any $0<\mu<\mu'$. For any choices of $\langle \mathcal{P}^*(\mu), w^*(\cdot; \mu) \rangle$ and $\langle \mathcal{P}^*\left(\mu'\right), w^*\left(\cdot; \mu'\right) \rangle$:
\begin{enumerate}[(i)]
\item $\displaystyle \sum_{A \in \mathcal{P}\left(\mu\right)} P_1\left(A\right)w^*\left(A; \mu\right) \leq \displaystyle \sum_{A \in \mathcal{P}\left(\mu'\right)} P_1\left(A\right)w^*\left(A; \mu'\right)$;
\item $H\left(\mathcal{P}^*\left(\mu\right), 1\right) \geq H\left(\mathcal{P}^*\left(\mu'\right), 1\right)$;
\item $|\mathcal{P}^*(\mu)|\geq |\mathcal{P}^*(\mu')|$ under Assumption \ref{assm_cf}(a).
\end{enumerate}
\end{prop}

\begin{proof}
Part (i) follows from the optimalities of $\mathcal{P}^*(\mu)$ and $\mathcal{P}^*(\mu')$. Parts (ii) and (ii) are immediate.
\end{proof}

Proposition \ref{prop_mu} shows that as data processing and analysis become cheaper, the principal pays less wage on average and the information carried by the output signal becomes finer. In the case where the monitoring cost is an increasing function of the rating scale (see, e.g., \cite{introhr}), the optimal rating scale is nonincreasing in $\mu$. For other monitoring cost functions such as entropy, we can first compute the cutoff $z$-values and then the optimal rating scale as in Example \ref{exm_main}.\footnote{In general, this is not an easy task because perturbations of cutoff $z$-values (which differ from the perturbation considered in Section \ref{sec_proofsketch}) affect wages endogenously through the Lagrange multipliers of the incentive constraints. } Figure \ref{figure_ratingscale} plots the numerical solutions obtained in a special case.

The above findings are consistent with several strands of empirical facts. Among others, access to IT has proven to increase the fineness of the performance grids among manufacturing companies, holding other things constant (\cite{bloomsurvey}; \cite{it}).\footnote{See the appendices of \cite{bloomvanreenenwp} for survey questions regarding the fineness of the performance grids, e.g., ``Each employee is given a red light (not performing), an amber light (doing well and meeting targets), a green light (consistently meeting targets, very high performer) and a blue light (high performer capable of promotion of up to two levels),''  versus ``rewards is based on an individual's commitment to the company measured by seniority.'' } Crowdsourcing the processing and analysis of real-time data has enabled the ``exact individual diagnosis'' that separates distinctive and mediocre performers in companies like GE and Zalando (\cite{mckinsey}).

\begin{figure}[!h]
    \centering
     \includegraphics[scale=.6]{Figure1.pdf}
    \caption{Plot the optimal rating scale against $\mu$: entropy cost, $u\left(w\right) =\sqrt{w}$, $Z \sim U\left[-1/2, 1/2\right]$, $c=1$, $K=100$.}\label{figure_ratingscale}
\end{figure}

\section{Extension: Multiple Agents}\label{sec_multiagent}
\subsection{Setup}\label{sec_multiagent_setup}
Each of the two agents $i=1,2$ earns a payoff $u_i\left(w_i\right)-c_i\left(a_i\right)$ from spending a nonnegative wage $w_i \geq 0$ and privately exerting high or low effort $a_i \in \{0,1\}$. The function $u_i:\mathbb{R}_+\rightarrow \mathbb{R}$ satisfies $u_i\left(0\right)=0$, $u_i'>0$ and $u''_i<0$, and $c_i\left(1\right)=c_i>c_i\left(0\right)=0$.

Each effort profile ${\bf{a}}=a_1 a_2$ generates a probability space $\left(\Omega, \Sigma, P_{{\bf{a}}}\right)$, where $\Omega$ is a finite-dimensional Euclidean space that comprises agents' performance data, $\Sigma$ is the Borel sigma-algebra on $\Omega$, and $P_{{\bf{a}}}$ is the probability measure on $\left(\Omega, \Sigma\right)$. $P_{{\bf{a}}}$'s are assumed to be mutually absolutely continuous, and the probability density function $p_{{\bf{a}}}$'s they induce are well-defined and everywhere positive.

In this new setting, a monitoring technology $\mathcal{P}$ can be any partition of $\Omega$ with at most $K$ cells that are all of positive measures, and a wage scheme ${\bf{w}}: \mathcal{P} \rightarrow \mathbb{R}_{+}^2$ maps each cell $A$ of $\mathcal{P}$ to a vector ${\bf{w}}\left(A\right)=\left(w_1\left(A\right), w_2\left(A\right)\right)^{\top}$ of nonnegative wages. For any data point $\omega$, let $A\left(\omega\right)$ be the unique performance category that contains $\omega$ and let ${\bf{w}}\left(A\left(\omega\right)\right)$ be the wage vector associated with $A\left(\omega\right)$. Time evolves as follows:
\begin{enumerate}
\item the principal commits to $\langle \mathcal{P}, {\bf{w}}\left(\cdot\right)\rangle$;
\item agent $i$ privately chooses $a_i \in \left\{0,1\right\}$, $i=1,2$;
\item Nature draws $\omega$ from $\Omega$ according to $P_{{\bf{a}}}$;
\item the monitoring technology outputs $A\left(\omega\right)$;
\item the principal pays $w_i\left(A\left(\omega\right)\right)$ to agent $i=1, 2$.
\end{enumerate}

Consider the problem of inducing both agents to exert high effort. Write $\bm{1}$ for $\left(1,1\right)^{\top}$ and define a vector-valued random variable ${\bf{Z}}=\left(Z_1, Z_2\right)^{\top}$ by
\[
Z_i\left(\omega\right)=1-\frac{p_{a_i=0, a_{-i}=1}\left(\omega\right)}{p_{\bm{1}}\left(\omega\right)} \text{ }  \forall \omega \in \Omega, i=1,2.
\]
Define the $\bf{z}$-value of any set $A \in \Sigma$ of positive measure by $\left(z_1\left(A\right), z_2\left(A\right)\right)^{\top}$, where
\[
z_i\left(A\right)=\mathbf{E}\left[Z_i \mid A; {\bf{a}}={\bf{1}}\right] \text{ } \forall  i=1,2.
\]
A contract is incentive compatible for agent $i$ if
\begin{equation}
\tag{IC$_i$} \sum_{A \in \mathcal{P}} P_{\bm{1}}(A)u_i\left(w_i\left(A\right)\right)z_i\left(A\right) \geq c_i, \label{eqn_ici}
\end{equation}
and it satisfies agent $i$'s limited liability constraint if
\begin{equation}
\tag{LL$_i$} w_i\left(A\right) \geq 0\text{ } \forall A \in \mathcal{P}. \label{eqn_lli}
\end{equation}
An optimal contract minimizes the total implementation cost under the high effort profile, subject to agents' incentive compatibility constraints and limited liability constraints:
\[
\min_{\langle \mathcal{P}, {\bf{w}}(\cdot) \rangle} \sum_{A \in \mathcal{P}} P_{{\bf{a}}}(A) \sum_{i=1}^2 w_i(A) + \mu \cdot H(\mathcal{P}, {\bf{1}}) \text{ s.t. (\ref{eqn_ici}) and (\ref{eqn_lli}), } i=1, 2.
\]

\subsection{Analysis}\label{sec_multiagent_analysis}
The next definition generalizes $Z$-convexity:
\begin{defn}
A set $A \in \Sigma$ is ${\bf{Z}}$-convex if the following holds for all $\omega', \omega'' \in A$ such that ${\bf{Z}}\left(\omega'\right) \neq {\bf{Z}}\left(\omega''\right)$:
\[
\left\{\omega \in \Omega: {\bf{Z}}\left(\omega\right)=(1-s) \cdot {\bf{Z}}\left(\omega'\right)+s \cdot {\bf{Z}}\left(\omega''\right) \text{ for some } s \in (0,1) \right\}\subset A.
\]
\end{defn}

The next two assumptions impose regularities on the principal's problem analogously to Assumptions \ref{assm_regular} and \ref{assm_compact}:

\begin{assm}\label{assm_regular_multiagent}
$\bf{Z}$ is distributed atomelessly on a connect set ${\bf{Z}}\left(\Omega\right)$ in $\mathbb{R}^2$ under ${\bf{a}}={\bf{1}}$.
\end{assm}

\begin{assm}\label{assm_compact_multiagent}
${\bf{Z}}\left(\Omega\right)$ is compact set in $\mathbb{R}^2$ with $\dim {\bf{Z}}\left(\Omega\right)=2$.
\end{assm}

The next theorems extend Theorems \ref{thm_main}  and \ref{thm_exist} to encompass multiple agents:

\begin{thm}\label{thm_multiagent}
Assume Assumptions \ref{assm_mc}, \ref{assm_regular_multiagent} and \ref{assm_compact_multiagent}. Then any optimal monitoring technology  comprises $\bf{Z}$-convex cells that constitute convex polygons in $\mathbb{R}^2$.
\end{thm}

\begin{thm}\label{thm_exist_multiagent}
An optimal incentive contract that induces high effort from both agents exists under Assumptions \ref{assm_mc}, \ref{assm_cf}, \ref{assm_regular_multiagent}  and  \ref{assm_compact_multiagent}.
\end{thm}

\begin{proof}
See Appendix \ref{sec_proof_multiagent}.
\end{proof}

\paragraph{Proof sketch} The proof strategy developed in Section \ref{sec_proofsketch} is useful for handling vector-valued $z$-values and wages. As before, fix any $\epsilon>0$, and take any subsets $A'_\epsilon$ and $A''_\epsilon$ of two distinct performance categories $A_j$ and $A_k$, respectively, such that $P_{\bf{1}}\left(A'_\epsilon\right)=P_{\bf{1}}\left(A''_\epsilon\right)=\epsilon$ and ${\bf{z}}\left(A'_\epsilon\right) = {\bf{z}}' \neq {\bf{z}}\left(A''_\epsilon\right) = {\bf{z}}''$ (Lemma \ref{lem_smallSet_multiagent} of Appendix \ref{sec_proof_multiagent_lemma} proves existence of sets that satisfy weaker properties). Post the perturbation as in Section \ref{sec_proofsketch}, the principal's Lagrangian becomes (ignore  (\ref{eqn_lli}) constraints):
\[\mathcal{L}\left(\epsilon\right)=\sum_{n}\pi_n\left(\sum_i w_{i,n}\left(\epsilon\right)-\lambda_i\left(\epsilon\right)u_i\left(w_{i,n}\left(\epsilon\right)\right) z_{i,n}\left(\epsilon\right)-c_i\right),\]
where $\pi_n$ denotes the probability of $A_n$ (equivalently, $A_n\left(\epsilon\right)$) under ${\bf{a}}={\bf{1}}$, $w_{i,n}\left(\epsilon\right)$ agent $i$'s optimal wage at $A_n\left(\epsilon\right)$ and $\lambda_i\left(\epsilon\right)$ the Lagrange multiplier associated with the (\ref{eqn_ici}) constraint. Assuming differentiability, we obtain
\[\mathcal{L}'\left(0\right)=-\sum_{n} \pi_n \cdot  {\bf{u}}_n^{\top}  \begin{pmatrix}
    \lambda_1\left(0\right)  & 0\\
    0      &  \lambda_2\left(0\right)
\end{pmatrix} \frac{d}{d\epsilon} {\bf{z}}_n\left(\epsilon\right)\bigg\vert_{\epsilon=0}=\left({\bf{u}}_k-{\bf{u}}_j\right)^{\top} \left(\widehat{\bf{z}}''-\widehat{\bf{z}}'\right), \]
where \[{\bf{u}}_n=\left(u_1\left(w_{i,n}\left(0\right)\right), u_2\left(w_{i,n}\left(0\right)\right)\right)^{\top}  \text{ } \forall n\]
and
\[\widehat{\bf{z}}= \begin{pmatrix}
    \lambda_1\left(0\right)  & 0\\
    0      &  \lambda_2\left(0\right)
\end{pmatrix} {\bf{z}} \text{ for } {\bf{z}}={\bf{z}}', {\bf{z}}''.\]
Since $\mathcal{L}'(0) \geq 0$ by optimality, the assignment of the Lagrange multiplier-weighted ${\bf{z}}$-values into performance categories must be  ``positive assortative,'' where the direction of sorting is given by the vector of agents' utilities. This implies $\bf{Z}$-convexity for the same reason as in  Section \ref{sec_proofsketch}.

\paragraph{Implications} Solving the optimal convex polygons is computationally hard. That said, note that the boundaries of convex polygons consist of straight line segments in ${\bf{Z}}\left(\Omega\right)$, which combined with Assumption \ref{assm_regular_multiagent} yields the following observations:
\begin{itemize}
\item any bi-partitional contract takes the form of either a team or a tournament and is fully captured by the intercept and slope of the straight line as depicted in Figure \ref{figure_group};

\bigskip

\begin{figure}[htp!]
\centering
\begin{minipage}[b]{0.48\linewidth}
  \includegraphics[scale=.43]{group.pdf}
\end{minipage}
\begin{minipage}[b]{0.48\linewidth}
  \includegraphics[scale=.43]{tournament.pdf}
\end{minipage}
\caption{Bi-partitional contracts: team and tournament. }
\label{figure_group}
\end{figure}

\item contracts that evaluate and reward agents on an individual basis are fully determined by the individual performance cutoffs as depicted in Figure \ref{figure_individual}.

\bigskip

\begin{figure}[htp!]
\centering
\includegraphics[scale=.43]{individual.pdf}
\caption{An individual incentive contract.}
\label{figure_individual}
\end{figure}
\end{itemize}

\subsection{Application: Individual vs. Group Evaluation}\label{sec_multiagent_application}
This section compares individual and group performance evaluations from the angle of monitoring cost. To obtain the sharpest insights, suppose that agents are \emph{technologically independent}:

\begin{assm}\label{assm_product}
There exist probability spaces $\left\{\left(\Omega_i, \Sigma_i, P_{i, a_i}\right)\right\}_{i, a_i}$ as in Section \ref{sec_baseline} such that $\left(\Omega, \Sigma, P_{{\bf{a}}}\right)=\left(\Omega_1 \times \Omega_2, \Sigma_1 \otimes \Sigma_2, P_{1, a_1} \times P_{2, a_2}\right)$ for all ${\bf{a}} \in \left\{0,1\right\}^2$.
\end{assm}

In the language of contract theory, Assumption \ref{assm_product} rules out any  \emph{technological link} (i.e., $\omega_i$ depends on $a_{-i}$) or \emph{common productivity shock} (i.e., $\omega_1, \omega_2$ are correlated given $\bf{a}$) between agents.

The next definition is standard:

\begin{defn}\label{defn_individualgroup}
\begin{enumerate}[(i)]
\item $\mathcal{P}$ is an \emph{individual monitoring technology} if for all $A \in \mathcal{P}$, there exist $A_1 \in \Sigma_1$ and $A_2 \in \Sigma_2$ such that $A=A_1 \times A_2$; otherwise $\mathcal{P}$ is a \emph{group monitoring technology};

\item Let $\mathcal{P}$ be any individual monitoring technology. Then ${\bf{w}}: \mathcal{P} \rightarrow \mathbb{R}_{+}^2$ is an \emph{individual wage scheme} if $w_i\left(A_i \times A_{-i}'; \mathcal{P}\right)=w_i\left(A_i \times A_{-i}''; \mathcal{P}\right)$ for all $i=1, 2$ and $A_i \times A_{-i}', A_i \times A_{-i}'' \in \mathcal{P}$; otherwise ${\bf{w}}: \mathcal{P} \rightarrow \mathbb{R}_{+}^2$ is a \emph{group wage scheme};

\item $\langle \mathcal{P}, {\bf{w}}: \mathcal{P} \rightarrow \mathbb{R}_{+}^2\rangle$ is an \emph{individual incentive contract} if $\mathcal{P}$ is an individual monitoring technology and ${\bf{w}}: \mathcal{P} \rightarrow \mathbb{R}_{+}^2$ is an individual wage scheme; otherwise it is a \emph{group incentive contract}.
\end{enumerate}
\end{defn}

By definition, a group incentive contract either conducts group performance evaluations or pairs individual performance evaluations with group incentive pays. Under Assumption \ref{assm_product}, the second option is sub-optimal by the sufficient statistics principle or \cite{holmstromteam}, thus reducing the comparison between individual and group incentive contracts to that of  individual and group performance evaluations.

Let $I$ be the ratio between the minimal cost of implementing bi-partitional incentive contracts and that of implementing individual incentive contracts (the latter, by definition, have at least four performance categories). $I<1$ is a definitive indicator that group evaluation is optimal whereas individual evaluation is not. The next result is immediate:

\begin{cor}\label{cor_multiagent}
Under Assumptions \ref{assm_mc}, \ref{assm_cf}(a), \ref{assm_regular_multiagent},  \ref{assm_compact_multiagent} and \ref{assm_product}, $I<1$ when $\mu$ is large.
\end{cor}

Beyond the case considered in Corollary \ref{cor_multiagent}, we can compute $I$ numerically based on the prior discussion about how to parameterize bi-partitional and individual incentive contracts. Figure \ref{figure_indicator} plots the solutions obtained in a special case.

\bigskip

\begin{figure}[h!]
\centering
\includegraphics[scale=.6]{Figure4.pdf}
\caption{Plot $I$ against $\mu$: entropy cost, $u_i\left(w\right)=\sqrt{w}$, $Z_i \sim U\left[-1/2, 1/2\right]$ and $c_i=1$ for $i=1,2$.}
\label{figure_indicator}
\end{figure}

Our result formalizes the theses of \cite{ad} and \cite{lazearrosen} that either team or tournament should be the dominant incentive system when individual performance evaluation is too costly to conduct. It enriches the analyses of \cite{holmstromteam}, \cite{greenstokey} and \cite{mookherjee}, which attribute the use of group incentive contracts to the technological dependence between agents while abstracting away from the issue of data processing and analysis. Recently, these views are reconciled by \cite{bloomvanreenenwp}, which find--just as our theory predicts--that companies make different choices between individual and group evaluations despite being technologically similar, and that  group evaluation is most prevalent when the capacity to sift out individual-level information is limited by, e.g., the lack of IT access.\footnote{See the survey questions of \cite{bloomvanreenenwp} regarding the choices between individual and group evaluations, e.g., ``employees are rewarded based on their individual contributions to the company,'' and ``compensation is based on shift/plant-level outcomes.'' The former is regarded as an advanced but expensive managerial practice and is more prevalent among companies with better IT access, other things being equal.} In the future, it will be interesting to nail down the role of IT in \cite{bloomvanreenenwp}, and to replicate these studies for recent advancements in data technologies.

\section{Extension: Multiple Actions}\label{sec_multidev}
In this section, suppose that the agent's action space $\mathcal{A}$ is a finite set, and that taking an action $a$ in $\mathcal{A}$ incurs a cost $c\left(a\right)$ to the agent and generates a probability space $\left(\Omega, \Sigma, P_a\right)$ as in Section \ref{sec_baseline}. The principal wishes to induce the most costly action $a^*$, i.e., $c\left(a^*\right)>c\left(a\right)$ for all $a \in \mathcal{D}=\mathcal{A}-\left\{a^*\right\}$. For any deviation from $a^*$ to $a \in \mathcal{D}$, define a random variable $Z_a: \Omega \rightarrow \mathbb{R}$ by
\[
Z_a\left(\omega\right)=1-\frac{p_a\left(\omega\right)}{p_{a^*}\left(\omega\right)} \text{ } \forall \omega \in \Omega.
\]
For any $a \in \mathcal{D}$ and set $A \in \Sigma$ of positive measure, define
\[
z_a\left(A\right)=\mathbf{E}\left[Z_a \mid A; a^*\right].
\]
A contract is incentive compatible if for all $a \in \mathcal{D}$:
\begin{equation}
\tag{IC$_a$} \sum_{A \in \mathcal{P}} P_{a^*}\left(A\right)u\left(w\left(A\right)\right)z_{a}\left(A\right) \geq c\left(a^*\right)-c\left(a\right).\label{eqn_ic_multidev}
\end{equation}
An optimal incentive contract $\langle \mathcal{P}^*, w^*\left(\cdot\right)\rangle$ that induces $a^*$ solves
\begin{equation*}
\min_{\langle \mathcal{P}, w(\cdot)\rangle} \sum_{A \in \mathcal{P}} P_{a^*}\left(A\right)w\left(A\right)+\mu \cdot H\left(\mathcal{P}, a^*\right) \text{ s.t. (\ref{eqn_ic_multidev}) $\forall a \in \mathcal{D}$ and (\ref{eqn_ll})}. \label{eqn_problem_multidev}
\end{equation*}

Write ${\bf{Z}}$ for $\left(Z_a\right)^{\top}_{a \in \mathcal{D}}$. For any $|\mathcal{D}|$-vector $\bm{\lambda}=\left(\lambda_a\right)^{\top}_{a \in \mathcal{D}}$ in $\mathbb{R}_{+}^{|\mathcal{D}|}$, define a random variable $Z_{{\bm{\lambda}}}: \Omega \rightarrow \mathbb{R}$ by
\[
Z_{\bm{\lambda}}\left(\omega\right)=\bm{\lambda}^{\top} {\bf{Z}}\left(\omega\right) \text{ } \forall \omega \in \Omega.
\]
The next definition generalizes $Z$-convexity:
\begin{defn}
A set $A \in \Sigma$ is $Z_{\bm{\lambda}}$-convex if the following holds for all  $\omega', \omega'' \in A$ such that $Z_{\bm{\lambda}}\left(\omega'\right) \neq Z_{\bm{\lambda}}\left(\omega''\right)$:
\[
\left\{\omega: Z_{\bm{\lambda}}\left(\omega\right)=\left(1-s\right)\cdot  Z_{\bm{\lambda}}\left(\omega'\right)+s \cdot Z_{\bm{\lambda}}\left(\omega''\right)  \text{ for some } s \in \left(0,1\right)\right\} \subset A.
\]
\end{defn}
The next theorems extend Theorems \ref{thm_main} and \ref{thm_exist} to encompass multiple actions:

\begin{thm}\label{thm_multidev}
Assume Assumption \ref{assm_mc} and Assumption \ref{assm_compact} for all $a \in \mathcal{D}$. Then for any optimal incentive contract $\langle \mathcal{P}^*, w^*\left(\cdot\right)\rangle$ that induces $a^{\ast}$, there exists $\bm{\lambda^*} \in \mathbb{R}_{+}^{|\mathcal{D}|}$ with $\|\bm{\lambda^*}\|>0$\footnote{$\|\cdot\| $ denotes the sup norm in the remainder of this paper.} such that all cells of $\mathcal{P}^*$ are $Z_{\bm{\lambda}^*}$-convex and can be labeled as $A_1,\cdots, A_N$ such that $0=w^*\left(A_1\right)<\cdots <w^*\left(A_N\right)$. Assume, in addition, Assumption  \ref{assm_regular} for all $a \in \mathcal{D}$. Then there exist $-\infty\leq \widehat{z}_0<\cdots< \widehat{z}_N<+\infty$ such that $A_n=\left\{\omega: Z_{\bm{\lambda}^*}\left(\omega\right) \in [\widehat{z}_{n-1}, \widehat{z}_n)\right\}$ for $n=1,\cdots, N$.
\end{thm}

\begin{thm}\label{thm_exist_multidev}
Assume Assumptions \ref{assm_mc} and \ref{assm_cf}, as well as  Assumptions \ref{assm_regular} and \ref{assm_compact} for all $a \in \mathcal{D}$. Then an optimal incentive contract that induces $a^*$ exists.
\end{thm}

\begin{proof}
See Appendix \ref{sec_proof_multidev}.
\end{proof}

In the presence of multiple actions, each data point is associated with finitely many $z$-values, each corresponding to a deviation from $a^*$ that the agent can potentially commit.  By establishing that the assignment of Lagrange multiplier-weighted $z$-values into wage categories is positive assortative, Theorem \ref{thm_multidev} relates the focus of data processing and analysis to the agent's endogenous tendencies to commit deviations. Intuitively, when $\lambda_a^*$ is large and hence the agent is tempted to commit deviation $a$, focus should be given to the information $Z_a$ that helps detect deviation $a$, and the final performance rating should vary significantly with the assessment of $Z_a$. The next section gives an application of this result.

\subsection{Application: Multiple Tasks}\label{sec_multitask_application}
A single agent can exert either high or low effort $a_i\in \{0,1\}$ in each of the two tasks $i=1,2$, and each $a_i$ independently generates a probability space $\left(\Omega_i, \Sigma_i, P_{i, a_i}\right)$ as in Section \ref{sec_baseline}. The goal of a risk-neutral principal is to induce high effort in both tasks.

Write ${\bf{a}}=a_1a_2$, $\bm{\omega}=\omega_1\omega_2$, $\mathcal{A}=\left\{11,01,10,00\right\}$, ${\bf{a}}^*=11$ and $\mathcal{D}=\left\{01, 10, 00\right\}$. For any $i=1,2$ and $\omega_i \in \Omega_i$, define
\[Z_i\left(\omega_i\right)=1-\frac{p_{i, a_i=0}\left(\omega_i\right)}{p_{i, a_i=1}\left(\omega_i\right)},\] where $p_{i,a_i}$ is the probability density function induced by $P_{i,a_i}$. For any $\bm{\omega} \in
\Omega_1 \times \Omega_2$ and $\bm{\lambda}=\left(\lambda_{01}, \lambda_{10}, \lambda_{00}\right)^{\top} \in \mathbb{R}_+^3$, define
\[
Z_{\bm{\lambda}}\left(\bm{\omega}\right)=\left(\lambda_{01}+\lambda_{00}\right) \cdot Z_{1}(\omega_1)+\left(\lambda_{10}+\lambda_{00}\right) \cdot Z_{2}\left(\omega_2\right)
-\lambda_{00} \cdot Z_{1}\left(\omega_1\right) Z_{2}\left(\omega_2\right).\]
The next corollary is immediate from Theorem \ref{thm_multidev}:

\begin{cor}\label{cor_multitask}
Assume Assumption \ref{assm_mc} and Assumption \ref{assm_compact} for all $a \in \mathcal{D}$. Then for any optimal incentive contract $\langle \mathcal{P}^*, w^*\left(\cdot\right)\rangle$ that induces high effort in both tasks, there exists $\bm{\lambda^*} \in \mathbb{R}_+^{3}$ with $\lambda^*_{01}+\lambda^*_{00}$, $\lambda^*_{10}+\lambda^*_{00}>0$ such that all cells of $\mathcal{P}^*$ are $Z_{\bm{\lambda}^*}$-convex and can be labeled as $A_1,\cdots, A_N$ such that $0=w^*\left(A_1\right)<\cdots <w^*\left(A_N\right)$. Assume, in addition, Assumption  \ref{assm_regular} for all $a \in \mathcal{D}$. Then there exist $-\infty\leq \widehat{z}_0<\cdots< \widehat{z}_N<+\infty$ such that $A_n=\left\{\bm{\omega}: Z_{\bm{\lambda}^*}\left(\bm{\omega}\right) \in [\widehat{z}_{n-1}, \widehat{z}_n)\right\}$ for $n=1,\cdots, N$.
\end{cor}

In a seminal paper, \cite{holmstrommilgrom} shows that when the agent faces  multiple tasks, over-incentivizing tasks that generate precise performance data may prevent the completion of tasks that generate noisy performance data. That analysis abstracts away from monitoring costs and focuses on the power of (linear) compensation schemes.

Corollary \ref{cor_multitask} delivers a different message: when it comes to allocating limited resources across the assessments of multiple task performances, the optimal allocation should reflect the agent's endogenous tendency to shirk each task. The usefulness of this result is illustrated by the next example:

\begin{example}\label{exm_multitask}
A cashier faces two tasks: to scan items and to project warmth to customers. A piece of performance data consists of the scanner data recorded by the point of sale (POS) system, as well as the feedback gathered from customers. By Corollary \ref{cor_multitask}, the following ratio:
\[
R=\frac{\lambda_{01}^*+\lambda_{00}^*}{\lambda_{10}^*+\lambda_{00}^*}
\]
captures how the principal should allocate limited resources across the assessments of skillfulness in scanning items and warmth. Intuitively, a small $R$ arises when the cashier is reluctant to project warmth to customers, in which case resources should be devoted to the assessment of warmth, and the final performance rating should depend significantly on such assessment.

We examine how optimal resource allocation varies with the precision of raw performance data. As in \cite{holmstrommilgrom}, we assume that
\begin{itemize}
\item $\omega_i=a_i+ \xi_i$ for $i=1,2$, where $\xi_i$'s are independent normal random variables with mean zero and variance $\sigma_i^2$'s;

\item the cashier has CARA utility of consumption $u(w)=1-\exp\left(-\gamma w\right)$.
\end{itemize}
Unlike \cite{holmstrommilgrom}, we do not confine ourselves to linear wage schemes.

In the case where the monitoring cost is an increasing function of the rating scale, we compute $R$ for different values of $\sigma_1^2$, holding $\sigma_2^2=1$ and $|\mathcal{P}|=2$ fixed. Our findings are reported in Figure \ref{figure_multitask}.
Assuming that our parameter choices are reasonable ones, we arrive at the following conclusion: as skillfulness becomes easier to measure--thanks to the advent of high quality scanner data--the cashier becomes more afraid to shirk the scanning task and less so about projecting coldness to customers; to correct the cashier's incentive, resources should be shifted towards the processing and analysis of customer feedback and away from that of scanner data. In the future, one can test this prediction by running field experiments as that of \cite{india}. For example, one can randomize the quality of scanner data among otherwise similar stores and examine the effect on resource allocation between scanner data and customer feedback.

\bigskip

\begin{figure}[!h]
    \centering
    \includegraphics[scale=.6]{Figure5.pdf}
    \caption{Plot $R$ against $\sigma_1^2$: $H\left(\mathcal{P},a\right)=f\left(|\mathcal{P}|\right)$, $|\mathcal{P}|=2$; $u\left(w\right)=1-\exp\left(-.5w\right)$; $c\left(00\right)=0$, $c\left(01\right)=0.3$, $c\left(10\right)=0.2$ and $c\left(11\right)=0.5$; $\xi_1$ and $\xi_2$ are normally distributed with mean zero and $\sigma_2^2=1$.}\label{figure_multitask}
    \end{figure}
\end{example}

\section{Conclusion}\label{sec_conclusion}
We conclude by posing open questions. First, our work is broadly related to the burgeoning literature on information design (see, e.g., \cite{bergemannmorris} for a survey), and we hope it inspires new research questions such as how to conduct costly yet flexible monitoring in long-term employment relationships. Second, our theory may guide  investigations into empirical issues such as how advancements in big data technologies have affected the design and implementation of monitoring technologies, and whether they can partially explain the heterogeneity in the internal organizations of otherwise similar firms. We hope that someone, maybe ourselves, will pursue these research agendas in the future.