Ad hoc is a Latin phrase meaning literally 'to this'. In English, it generally signifies a solution designed for a specific problem or task, non-generalizable, and not intended to be adapted to other purposes (compare with a priori).
Common examples are ad hoc committees and commissions created at the national or international level for a specific task. In other fields, the term could refer, for example, to a military unit created under special circumstances (see task force), a tailor-made suit, a handcrafted network protocol (e.g., ad hoc network), a temporary banding together of geographically-linked franchise locations (of a given national brand) to issue advertising coupons, or a purpose-specific equation.
Ad hoc can also be an adjective describing the temporary, provisional, or improvised methods to deal with a particular problem, the tendency of which has given rise to the noun adhocism.
Style guides disagree on whether Latin phrases like ad hoc should be italicized. The trend is not to use italics. For example, The Chicago Manual of Style recommends that familiar Latin phrases that are listed in the Webster's Dictionary, including "ad hoc", not be italicized.
In science and philosophy, ad hoc means the addition of extraneous hypotheses to a theory to save it from being falsified. Ad hoc hypotheses compensate for anomalies not anticipated by the theory in its unmodified form.
Scientists are often skeptical of scientific theories that rely on frequent, unsupported adjustments to sustain them. Ad hoc hypotheses are often characteristic of pseudo-scientific subjects such as homeopathy.
In the military, ad hoc units are created during unpredictable situations, when the cooperation between different units is suddenly needed for fast action, or from remnants of previous units which have been overrun or otherwise whittled down.
The term ad hoc networking typically refers to a system of network elements that combine to form a network requiring little or no planning.